-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mkdocs and cleaner notation/description (#4)
* clean description, use mkdocs * Update docs/approach.md Co-authored-by: Scott Olesen <[email protected]> * pre commit cleanup --------- Co-authored-by: Scott Olesen <[email protected]>
- Loading branch information
Showing
9 changed files
with
982 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Using Next Generation Matrices | ||
|
||
The NGM for a 4-Group Infectious Disease Model with compartments $S_g$, $I_g$, $R_g$: Susceptible, Infected, and Recovered compartments in the $G$ groups $g = 1, \dots, G$. Where possible we try to be general, otherwise we will take $K = 4$ | ||
|
||
Dynamics for $I_k$ in each group given by: | ||
|
||
$$ | ||
\frac{d I_g}{dt} = \sum_{j} \frac{\beta_{jg} S_j I_j}{N_j} - \gamma_g I_g | ||
$$ | ||
|
||
where: | ||
|
||
- $\beta_{jg}$: Transmission rate from group $j$ to group $g$, | ||
- $S_j$: Susceptible population in group $j$, | ||
- $N_j$: Total population in group $j$, | ||
- $\gamma_g$: Recovery rate in group $g$. | ||
|
||
The NGM is calculated at the disease free equilibrium (DFE) where | ||
|
||
$$ | ||
I_g = 0, S_g = N_g \ \text{for all\ } g | ||
$$ | ||
|
||
--- | ||
|
||
And then the NGM `K` is given by: | ||
|
||
$$ | ||
\mathbf{K} = \mathbf{F} \mathbf{V}^{-1} | ||
$$ | ||
|
||
where $\mathbf{F}$ is the matrix of new infections and $\mathbf{V}$ is the matrix of transitions between compartments, not representing new infections. | ||
|
||
The elements of $\mathbf{F}$ are | ||
|
||
$$ | ||
\mathbf{F}_{ij} = \frac{\beta_{ij} S_j}{N_j} | ||
$$ | ||
|
||
while $\mathbf{V}$ is a diagonal matrix with $\mathbf{V}_{ii} = \gamma$ where the recovery rate is shared among all groups $g$. | ||
|
||
Since $\mathbf{V}$ is diagonal, its inverse is as well, with $(\mathbf{V}^{-1})_{ij} = 1 / \gamma_i$. | ||
|
||
Thus, $\mathbf{K}$ is given by | ||
|
||
$$ | ||
\mathbf{K}_{ij} = \frac{\beta_{ij} S_j}{\gamma_j N_j} | ||
$$ | ||
|
||
which we can re-write as | ||
|
||
$$ | ||
\mathbf{K}_{ij} = R_{ij} \frac{S_j}{N_j} | ||
$$ | ||
|
||
The basic reproductive number $R_0$ is calculated as the dominant eigenvalue of $K$, while $R_0$ multiplied by the fraction of susceptibles yields the effective reproduction number $R_e$. | ||
|
||
The distribution of infections is calculated from the dominant eigenvector of $K$. | ||
|
||
Severe infections are calculated by multiplying the proportion of infections in each group by a group-specific probability of severe infection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Next generation matrix widget | ||
|
||
Read about the [approach](approach.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
document$.subscribe(({ body }) => { | ||
renderMathInElement(body, { | ||
delimiters: [ | ||
{ left: "$$", right: "$$", display: true }, | ||
{ left: "$", right: "$", display: false }, | ||
{ left: "\\(", right: "\\)", display: false }, | ||
{ left: "\\[", right: "\\]", display: true } | ||
], | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
site_name: cfa-ngm-widget | ||
|
||
nav: | ||
- index.md | ||
- approach.md | ||
|
||
theme: | ||
name: "material" | ||
|
||
plugins: | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
options: | ||
show_root_heading: true | ||
show_full_root_path: true | ||
- search | ||
|
||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences | ||
- pymdownx.arithmatex: | ||
generic: true | ||
- mdx_truly_sane_lists | ||
- pymdownx.superfences: | ||
custom_fences: | ||
- name: mermaid | ||
class: mermaid | ||
format: !!python/name:pymdownx.superfences.fence_code_format | ||
|
||
extra_javascript: | ||
- javascript/katex.js | ||
- https://unpkg.com/katex@0/dist/katex.min.js | ||
- https://unpkg.com/katex@0/dist/contrib/auto-render.min.js | ||
|
||
extra_css: | ||
- https://unpkg.com/katex@0/dist/katex.min.css |
Oops, something went wrong.