Skip to content

Commit 078e50c

Browse files
committed
markdown source builds
Auto-generated via `{sandpaper}` Source : 50ae5b9 Branch : main Author : Andree Valle Campos <avallecam@gmail.com> Time : 2024-11-21 08:03:31 +0000 Message : fix and update renv lock
1 parent 5aca77b commit 078e50c

8 files changed

+186
-35
lines changed

BF_measles.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -888,18 +888,12 @@ output4 <- epidemics::model_default(
888888
transmission_rate = 15 / 5, # R0 / infectious period = 3
889889
infectiousness_rate = 1 / 8, # 1 / latent period (pre-infectious phase)
890890
recovery_rate = 1 / 5, # 1 / infectious period
891-
intervention = list(transmission_rate = reduced_contacts),
891+
intervention = list(contacts = reduced_contacts),
892892
vaccination = vaccinate_elders,
893893
time_end = 120, # Simulation over 75 days
894894
increment = 1 # Daily increments
895895
)
896-
```
897-
898-
``` error
899-
Error in FUN(X[[i]], ...): Assertion on 'x' failed: Must inherit from class 'rate_intervention', but has classes 'contacts_intervention','intervention'.
900-
```
901896

902-
``` r
903897
# Plot the epidemic curve (infectious individuals)
904898
output4 %>%
905899
filter(compartment == "infectious") %>% # Filter for infectious individuals
@@ -935,6 +929,4 @@ output4 %>%
935929
)
936930
```
937931

938-
``` error
939-
Error in eval(expr, envir, enclos): object 'output4' not found
940-
```
932+
<img src="fig/BF_measles-rendered-unnamed-chunk-12-1.png" style="display: block; margin: auto;" />

compare-interventions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ head(output)
467467
6: 0.4925786 0.25 0.1818182 300 2
468468
population intervention vaccination time_dependence increment scenario
469469
<list> <list> <list> <list> <num> <int>
470-
1: <population[4]> <list[1]> <list[1]> 1 1
471-
2: <population[4]> <list[1]> <list[1]> 1 2
472-
3: <population[4]> <list[2]> <list[1]> 1 3
473-
4: <population[4]> <list[1]> <list[1]> 1 1
474-
5: <population[4]> <list[1]> <list[1]> 1 2
475-
6: <population[4]> <list[2]> <list[1]> 1 3
470+
1: <population[4]> <list[1]> [NULL] <list[1]> 1 1
471+
2: <population[4]> <list[1]> [NULL] <list[1]> 1 2
472+
3: <population[4]> <list[2]> [NULL] <list[1]> 1 3
473+
4: <population[4]> <list[1]> [NULL] <list[1]> 1 1
474+
5: <population[4]> <list[1]> [NULL] <list[1]> 1 2
475+
6: <population[4]> <list[2]> [NULL] <list[1]> 1 3
476476
data
477477
<list>
478478
1: <data.table[4515x4]>
@@ -669,8 +669,8 @@ intervention_effect
669669
``` output
670670
scenario averted_median averted_lower averted_upper
671671
<int> <num> <num> <num>
672-
1: 1 35 2 126
673-
2: 2 25 -15 132
672+
1: 1 34 1 120
673+
2: 2 23 -17 124
674674
```
675675

676676

47.3 KB
Loading
-2.47 KB
Loading
-26 Bytes
Loading

files/hands-on.tex

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
\documentclass{article}
2+
\usepackage{fancyhdr}
3+
4+
% Set up the custom footer
5+
\pagestyle{fancy}
6+
\fancyfoot[R]{\thepage} % Centered page number in footer
7+
\fancyfoot[C]{\textbf{License:} CC-BY.\textbf{Copyright:} Andree \& Degoot, 2024 }
8+
\usepackage{tikz}
9+
\usetikzlibrary{arrows.meta, positioning}
10+
\usepackage{amsmath}
11+
\author{Andree Valle Campos and Abdoelnaser M Degoot \\ Epiverse-TRACE Team @ LSHTM }
12+
\title{Simple Introduction to Mathematical Modelling of Infectious Diseases}
13+
\begin{document}
14+
\maketitle
15+
16+
\section{Introduction}
17+
This practical aims to assess your understanding of the fundamental
18+
principles of mathematical modeling while guiding you in constructing models using
19+
a simple SEIR framework for infectious disease outbreaks.\\
20+
21+
\textbf{Note: Please fill in the blanks.}
22+
23+
\section{SEIR Model}
24+
25+
In the SEIR model, we have four compartments (\( S \), \( E \), \( I \), \( R \)):
26+
27+
\begin{itemize}
28+
\item \( S \) stands for \underline{\hspace{2cm}}, meaning \underline{\hspace{6cm}}.
29+
The parameter that explains the transition from (\( S \)) compartment
30+
to (\( E \)) compartment is \underline{\hspace{6cm}}.
31+
\item \(E\) stands for \underline{\hspace{2cm}}, meaning that it can
32+
\underline{\hspace{4cm}}.
33+
34+
The rate that explains the transition from (\( E \)) to (\( I \)) is the rate of \underline{\hspace{1cm}}.
35+
36+
\item \( I \) stands for \underline{\hspace{2cm}}, meaning that it can
37+
\underline{\hspace{3cm}}.
38+
The rate that explains the transition from (\( I \)) to (\( R \)) is the rate of \underline{\hspace{6cm}}.
39+
40+
\item \( R \) stands for \underline{\hspace{3cm}}. This compartment includes those who have ceased to be infectious and acquire immunity against infection, regardless of the clinical course.
41+
\end{itemize}
42+
43+
\section{\( R_0 \)}
44+
\( R_0 \) helps project the potential
45+
size of an epidemic and calculate the herd immunity threshold.
46+
It is defined as the average number of \underline{\hspace{2cm}} secondary cases
47+
generated from a primary case in a completely
48+
\underline{\hspace{3cm}} population.
49+
50+
\section{\( R_t \)}
51+
\( R_t \)
52+
helps monitor the progress of the epidemic
53+
When the population is no longer \underline{\hspace{2cm}}, the instantaneous
54+
reproduction number \( R_t \) is used. This is defined as the average number
55+
of s\underline{\hspace{2cm}} in a population composed of
56+
\underline{\hspace{2cm}} and non-\underline{\hspace{2cm}} individuals at time \( t \).
57+
58+
\section{A Diagram for Measles outbreak}
59+
60+
Below is a typical SEIR model with demography (births and deaths). This is a simple
61+
model applicable to person-to-person infections in a homogeneously mixing population.
62+
Please carefully observe the model and examine the interactions with the equations
63+
in section \ref{eqs}. Use color codes or arrows to relate the diagram to the equations.
64+
65+
66+
\begin{center}
67+
\begin{tikzpicture}[
68+
node distance=2cm,
69+
every node/.style={fill=blue!10, draw, minimum size=1cm, text centered},
70+
arrow/.style={-Stealth, thick}
71+
]
72+
73+
% Nodes
74+
\node [circle, fill=green!75](S) {$S$};
75+
\node [circle, fill=orange!75](E) [right=of S] { $E$};
76+
\node [circle, fill=red!75](I) [right=of E] {$I$};
77+
\node [circle, fill=blue!75](R) [right=of I] {$R$};
78+
79+
% Arrows for transitions
80+
\draw[arrow] (S) -- node[above, draw=none] {$\beta S \frac{I}{N}$} (E);
81+
\draw[arrow] (E) -- node[above, draw=none] {$\sigma E$} (I);
82+
\draw[arrow] (I) -- node[above, draw=none] {$\gamma I$} (R);
83+
84+
% Natural birth and death rates
85+
\draw[arrow] (-2,0.0) -- node[above, draw=none] {$\Lambda N$} (S);
86+
\draw[arrow] (S) -- +(0,-1.2) node[below, draw=none] {$\mu$};
87+
\draw[arrow] (E) -- +(0,-1.2) node[below, draw=none] {$\mu$ };
88+
\draw[arrow] (I) -- +(0,-1.2) node[below, draw=none] {$\mu$ };
89+
\draw[arrow] (R) -- +(0,-1.2) node[below, draw=none] {$\mu$};
90+
91+
\end{tikzpicture}
92+
\end{center}
93+
94+
Where:
95+
\begin{itemize}
96+
\item \( \beta \): Transmission rate
97+
\item \( \sigma \): Rate of progression from exposed to infectious
98+
\item \( \gamma \): Recovery rate
99+
\item \( \mu \): Death rate (natural death rate)
100+
\item \( N \): Total population size, \( N = S + E + I + R \).
101+
\end{itemize}
102+
103+
The parameter $\beta$ is derived from the multiplication of $p$
104+
and $c$, where $p$ is the probability of transmission during contact, and $c$
105+
is the contact rate, defined as the average number of contacts per unit of time.\\
106+
107+
Model parameters are often (but not always) specified as rates.
108+
The rate at which an event occurs is the inverse of the average time until that event.
109+
For example, in the SEIR model, the recovery rate $\gamma$ is the inverse of the average infectious period.\\
110+
111+
Values of these rates can be determined from the natural history of the disease.
112+
For example, if people are on average infectious for 8 days, then in the model,
113+
1/8 of currently infectious people would recover each day
114+
(i.e. the rate of recovery, $\gamma=1/8=0.125$).
115+
116+
\section{Equations}\label{eqs}
117+
Note that in the diagram, arrows entering compartments are expressed as positive
118+
terms in the equations, while arrows exiting compartments are represented with negative terms.
119+
Based on the above diagram,deduce the following equations that describe this system:
120+
121+
\section*{Compartment Equations}
122+
123+
\begin{itemize}
124+
\item \textbf{S compartment:}
125+
\[
126+
\frac{dS}{dt} =
127+
\]
128+
129+
\item \textbf{E compartment:}
130+
\[
131+
\frac{dE}{dt} =
132+
\]
133+
\item \textbf{I compartment:}
134+
\[
135+
\frac{dI}{dt} = \
136+
\]
137+
138+
\item \textbf{R compartment:}
139+
\[
140+
\frac{dR}{dt} =
141+
\]
142+
\end{itemize}
143+
144+
\section{Computing $R_0$}
145+
The expression for the basic reproduction number ($R_0$) in the above system is given by:
146+
147+
\begin{equation*} R_0 = \frac{\mu}{(\mu + \alpha)} \frac{\beta}{(\mu + \gamma)}. \end{equation*}
148+
149+
To calculate the $R_0$ value for given parameter values, write an R function
150+
called Measles$R_0$ that implements this formula. The function will use the following parameter values:
151+
152+
\begin{itemize}
153+
\item $\mu = \frac{1}{75}$ (natural mortality rate)
154+
\item $\alpha = \frac{1}{10}$ (rate of progression from the exposed to the infectious stage)
155+
\item $\gamma = 1/8$ (recovery rate)
156+
\item $\beta = 1.8$ (transmission rate)
157+
\end{itemize}
158+
Then compute the final size of such epidemic.
159+
\end{document}

md5sum.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"file" "checksum" "built" "date"
2-
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2024-11-20"
3-
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2024-11-20"
4-
"config.yaml" "01ba2faa4b450855eba2fba32408867c" "site/built/config.yaml" "2024-11-20"
5-
"index.md" "32bc80d6f4816435cc0e01540cb2a513" "site/built/index.md" "2024-11-20"
6-
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-11-20"
7-
"episodes/simulating-transmission.Rmd" "946faeb2fbc86729c97e1e64bf66add2" "site/built/simulating-transmission.md" "2024-11-20"
8-
"episodes/model-choices.Rmd" "597b512fd487349fe19eeb1ce3b565dc" "site/built/model-choices.md" "2024-11-20"
9-
"episodes/modelling-interventions.Rmd" "92be2434ff4fd8fd79eb981fc45687a3" "site/built/modelling-interventions.md" "2024-11-20"
10-
"episodes/compare-interventions.Rmd" "2d9b19604352386139e3527d4a6e5918" "site/built/compare-interventions.md" "2024-11-20"
11-
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2024-11-20"
12-
"learners/BF_measles.Rmd" "75ffa2132303869bcbe06860b0df915d" "site/built/BF_measles.md" "2024-11-20"
13-
"learners/reference.md" "3c3b0a87a98f91231d47f5a2e24ad27d" "site/built/reference.md" "2024-11-20"
14-
"learners/setup.md" "84c16abddfc207bfb445fdd69d4f36a9" "site/built/setup.md" "2024-11-20"
15-
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2024-11-20"
16-
"renv/profiles/lesson-requirements/renv.lock" "0e9e6749e654d8b35316a834ce98d55b" "site/built/renv.lock" "2024-11-20"
2+
"CODE_OF_CONDUCT.md" "549f00b0992a7743c2bc16ea6ce3db57" "site/built/CODE_OF_CONDUCT.md" "2024-11-21"
3+
"LICENSE.md" "14377518ee654005a18cf28549eb30e3" "site/built/LICENSE.md" "2024-11-21"
4+
"config.yaml" "01ba2faa4b450855eba2fba32408867c" "site/built/config.yaml" "2024-11-21"
5+
"index.md" "32bc80d6f4816435cc0e01540cb2a513" "site/built/index.md" "2024-11-21"
6+
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-11-21"
7+
"episodes/simulating-transmission.Rmd" "946faeb2fbc86729c97e1e64bf66add2" "site/built/simulating-transmission.md" "2024-11-21"
8+
"episodes/model-choices.Rmd" "597b512fd487349fe19eeb1ce3b565dc" "site/built/model-choices.md" "2024-11-21"
9+
"episodes/modelling-interventions.Rmd" "92be2434ff4fd8fd79eb981fc45687a3" "site/built/modelling-interventions.md" "2024-11-21"
10+
"episodes/compare-interventions.Rmd" "2d9b19604352386139e3527d4a6e5918" "site/built/compare-interventions.md" "2024-11-21"
11+
"instructors/instructor-notes.md" "ca3834a1b0f9e70c4702aa7a367a6bb5" "site/built/instructor-notes.md" "2024-11-21"
12+
"learners/BF_measles.Rmd" "b52966318d82c3aad50bb22e520c0d79" "site/built/BF_measles.md" "2024-11-21"
13+
"learners/reference.md" "3c3b0a87a98f91231d47f5a2e24ad27d" "site/built/reference.md" "2024-11-21"
14+
"learners/setup.md" "84c16abddfc207bfb445fdd69d4f36a9" "site/built/setup.md" "2024-11-21"
15+
"profiles/learner-profiles.md" "31b503c4b5bd1f0960ada730eca4a25e" "site/built/learner-profiles.md" "2024-11-21"
16+
"renv/profiles/lesson-requirements/renv.lock" "8559fb10ebd57157111bd2be682f9c18" "site/built/renv.lock" "2024-11-21"

simulating-transmission.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ contact_matrix
154154

155155

156156
``` output
157-
158-
contact.age.group [,1] [,2] [,3]
157+
age.group
158+
contact.age.group [0,20) [20,40) 40+
159159
[0,20) 7.883663 2.794154 1.565665
160160
[20,40) 3.120220 4.854839 2.624868
161161
40+ 3.063895 4.599893 5.005571

0 commit comments

Comments
 (0)