generated from jamesmbaazam/QuartoPresentationTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_04_sir_model.qmd
408 lines (245 loc) · 17.5 KB
/
_04_sir_model.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
![](/images/model_diagrams/model_diagrams.001.jpeg){width="40%" fig-align="center"}
This model groups individuals into three *disease states*:
- [Susceptible (S)]{style="color:green;"}: not infected but can be.
- [Infected (I)]{style="color:tomato;"}: infected & infectious.
- [Recovered/removed (R)]{style="color:blue;"}: recovered & immune.
------------------------------------------------------------------------
### How do individuals move between compartments?
#### Process 1: Transmission
![](images/model_diagrams/model_diagrams.002.jpeg){width="70%"}
[What drives transmission?]{style="color:red;"}
------------------------------------------------------------------------
- Transmission is driven by several factors, including:
- Disease prevalence, [$I$]{style="color:blue;"}, i.e., number of infected individuals at the time.
- The number of contacts, [$C$]{style="color:blue;"}, susceptible individuals have with infected individual.
- The probability, [$p$]{style="color:blue;"}, a susceptible individual will become infected when they contact an infected individual.
------------------------------------------------------------------------
![](images/model_diagrams/model_diagrams.002.jpeg){width="70%"}
The transmission term is often defined through the [force of infection (FOI), $\lambda$]{style="color:tomato;"}.
------------------------------------------------------------------------
### A tour of the force of infection (FOI)
- FOI, $\lambda$, is the [per capita rate]{style="color:tomato;"} at which susceptible individuals become infected.
::: {.callout-note collapse="true" icon="false"}
"Per capita" means the rate of an event occurring per individual in the population per unit of time.
:::
- Given the rate per individual per time, FOI, the rate at which new infecteds are generated is given by [$\lambda \times S$]{style="color:blue;"}, where $S$ is the number of susceptible individuals.
------------------------------------------------------------------------
- The force of infection is made up of the probabilities/rates that:
- contacts happen, [$c$]{style="color:blue"},
- a given contact is with an infected individual, [$p$]{style="color:blue"}, and
- a contact results in successful transmission, [$v$]{style="color:blue"}.
------------------------------------------------------------------------
- The FOI can be formulated in two ways, depending on how the contact rate is expected to change with the population size:
- Frequency-dependent/mass action transmission
- Density-dependent transmission
------------------------------------------------------------------------
#### Frequency-dependent/mass action transmission
The rate of contact between individuals is constant irrespective of the population density, [$\dfrac{N}{A}$]{style="color:blue"}, where [$N$]{style="color:blue"} is the population size and [$A$]{style="color:blue"} is the area occupied by the population.
------------------------------------------------------------------------
- Recall that transmission also depends on the probability of contact with an infected host, [$p$]{style="color:blue"}, which is assumed to be [$\dfrac{I}{N}$]{style="color:blue"}.
- Hence, the frequency-dependent mass action is given by [$\lambda = \beta \times \dfrac{I}{N}$]{style="color:blue"}, where [$\beta$]{style="color:blue"} is the transmission rate.
------------------------------------------------------------------------
::: {.callout-caution collapse="true" icon="false"}
#### Question
Why does the frequency-dependent transmission contain [$\dfrac{1}{N}$]{style="color:blue"} if it does not depend on the population density?
:::
------------------------------------------------------------------------
- Assume that the rate of new infections is given by [$\dfrac{dI}{dt} = S \times c \times p \times v$]{style="color:blue"} where [$S$]{style="color:blue"} is the number of susceptible hosts, [$c$]{style="color:blue"} is the contact rate, and [$p$]{style="color:blue"} is the probability of contact with an infected host, and [$v$]{style="color:blue"} is the probability of transmission per contact.
------------------------------------------------------------------------
- [$p$]{style="color:blue"} is usually assumed to be the disease prevalence, [$\dfrac{I}{N}$]{style="color:blue"}.
- Hence, the rate of new infections, [$\dfrac{dI}{dt} = S \times c \times \dfrac{I}{N} \times v$]{style="color:blue;"}.
------------------------------------------------------------------------
- In frequency dependent transmission, the contact rate [$c$]{style="color:blue"} is also assumed to be constant, say [$c = \eta$]{style="color:blue"} irrespective of population density, [$\dfrac{N}{A}$]{style="color:blue"}, where [$N$]{style="color:blue"} is the population size and [$A$]{style="color:blue"} is the area occupied by the population.
- Hence, [$\dfrac{dI}{dt} = S \times \eta \times v \times \dfrac{I}{N}$]{style="color:blue"}
- Therefore, [$\dfrac{dI}{dt} = \beta S \times \dfrac{I}{N}$]{style="color:blue"}, where [$\beta = \eta \times v$]{style="color:blue"}, and [$\lambda = \beta \times \dfrac{I}{N}$]{style="color:blue"}.
------------------------------------------------------------------------
- [*Frequency-dependent/mass action transmission*]{style="color:tomato;"} is often used to model sexually-transmitted diseases and diseases with heterogeneity in contact rates.
- Sexual transmission in this case does not depend on how many infected individuals are in the population.
------------------------------------------------------------------------
#### Density dependent transmission
- The rate of contact between individuals depends on the population density, [$\dfrac{N}{A}$]{style="color:blue"}.
- Transmission also depends on [$p$]{style="color:blue"} - the probability that a given contact is with an infected individual, often taken to be [$\dfrac{I}{N}$]{style="color:blue"}.
------------------------------------------------------------------------
- The density-dependent transmission is therefore given as [$\lambda = \beta \times \dfrac{I}{A}$]{style="color:blue"}.
- Here, because transmission increases with the density of infected individuals, it is called density-dependent transmission.
::: {.callout-note collapse="true" icon="false"}
- Notice that [$\lambda = \beta \times \dfrac{I}{N} \times \dfrac{N}{A}$]{style="color:blue"} and the $N's$ cancel out.
- [$A$]{style="color:blue"} is often ignored.
:::
------------------------------------------------------------------------
- [*Density dependent transmission*]{style="color:tomato;"} can be used to model airborne and directly transmitted diseases, for example, measles.
------------------------------------------------------------------------
::: {.callout-caution collapse="true" icon="false"}
#### Density-dependent vs frequency dependent transmission
This is one of the most confused and debated concepts in disease modelling. Several studies have attempted to clarify it, including the brilliant work by @begon2002clarification. Most of the clarifications provided here are based on this paper.
:::
- We will only use the [density-dependent]{style="color:tomato;"} formulation in this course.
------------------------------------------------------------------------
![](images/model_diagrams/model_diagrams.003.jpeg)
------------------------------------------------------------------------
#### Process 2: Recovery
![](images/model_diagrams/model_diagrams.005.jpeg){width="60%" fig-align="center"}
[Recovery]{style="color:tomato;"}, governed by the recovery rate, $\gamma$ (rate at which infected individuals recover and become immune).
------------------------------------------------------------------------
##### Some notes on the recovery process
- If the duration of infection is [$\dfrac{1}{\gamma}$]{style="color:blue"}, then the rate at which infected individuals recover is [$\gamma$]{style="color:blue"}.
- The average infectious period is often [estimated from epidemiological data]{style="color:tomato;"}.
::: {.callout-note collapse="true" icon="false"}
You will learn about parameter estimation in the model fitting and calibration lectures.
:::
------------------------------------------------------------------------
![Source: @anderson1982directly](images/epi_parameters.png)
------------------------------------------------------------------------
### Putting it all together
![An SIR model with transmission rate, $\beta$, and recovery rate, $\gamma$.](images/model_diagrams/model_diagrams.006.jpeg){width="80%"}
------------------------------------------------------------------------
### Formulating the model equations
[Continuous time compartmental]{style="color:tomato;"} models are formulated using [differential equations]{style="color:tomato;"} that describe the change in the number of individuals in each compartment over time.
------------------------------------------------------------------------
The SIR model can be formulated as:
::::: columns
::: {.column width="50%"}
![](images/model_diagrams/model_diagrams.006.jpeg){fig-align="center"}
:::
::: {.column width="50%"}
\begin{align*}
\frac{dS}{dt} & = \dot{S} = \color{orange}{-\beta S I} \\
\frac{dI}{dt} & = \dot{I} = \color{orange}{\beta S I} - \color{blue}{\gamma I} \\
\frac{dR}{dt} & = \dot{R} = \color{blue}{\gamma I}
\end{align*}
:::
:::::
where [$\beta$]{style="color:blue;"} is the transmission rate, and [$\gamma$]{style="color:blue;"} is the recovery rate.
::: notes
- We may or may not use the dot notation to denote the rate of change.
- The terms are just **inflows** and **outflows**.
- **Pause** for questions and clarifications.
:::
------------------------------------------------------------------------
The initial conditions are given by:
\begin{equation*}
\begin{aligned}
S(0) & = N - 1,\\
I(0) & = 1, \text{and} \\
R(0) & = 0.
\end{aligned}
\end{equation*}
where $N$ is the total population size.
------------------------------------------------------------------------
::: {.callout-note collapse="true" icon="false"}
- We represent the compartments as [population sizes]{style="color:tomato;"}.:
- Some modellers often use [proportions]{style="color:tomato;"} instead of population sizes as a way to remove the dimensions from the equations.
:::
------------------------------------------------------------------------
### Model assumptions
- The population is closed: no births, deaths, or migration.
- Implicitly: the epidemic occurs much faster than the time scale of births, deaths, or migration.
- Individuals are infectious immediately after infection and remain infectious until they recover.
------------------------------------------------------------------------
- Mixing is *homogeneous*, i.e., [individuals mix randomly]{style="color:tomato;"}:
- Individuals have an equal probability of coming into contact with any other individual in the population.
- Transition rates are constant and do not change over time.
- Individuals acquire "lifelong" immunity after recovery.
::: notes
The $R$ compartment is an absorbing state in this model.
:::
------------------------------------------------------------------------
::: {.callout-caution collapse="true" icon="false"}
#### Discussion
- What diseases do you think the SIR model is appropriate for?
:::
------------------------------------------------------------------------
- The SIR model is appropriate for diseases that confer immunity after recovery. For example, measles and chicken pox.
- Popularised by Kermack and McKendrick in 1927 [@kermack1927contribution]
- A must-read paper for budding infectious disease modellers.
------------------------------------------------------------------------
### What questions can we answer with the SIR model?
- The SIR model can be used to understand the dynamics of an epidemic:
- How long will the epidemic last?
- How many individuals will be infected (final epidemic size)?
- When will the epidemic reach its peak?
------------------------------------------------------------------------
## Solving the SIR model
- Compartmental models cannot be solved analytically.
- We often perform two types of analyses to understand the [long term dynamics]{style="color:tomato;"} of the model:
- Qualitative: threshold phenomena and analysis of equilibria (disease-free and endemic).\
- Numerical simulations.
::: callout-note
- For this introductory course, we will use focus on simulation.
:::
- But first, let's do some qualitative analysis of the SIR.
------------------------------------------------------------------------
### Threshold phenomena
- Here, we study the conditions under which an epidemic will [grow or die out]{style="color:tomato;"} using the model equations.
------------------------------------------------------------------------
- Consider the case where $I(0) = 1$ individual is introduced into a population of size $N$ at time $t = 0$.
- That means in a completely susceptible population, we have $S(0) = N - 1$ susceptible individuals.
------------------------------------------------------------------------
- At time 0, the disease will not spread if the rate of change of infections is negative, that is [$\dfrac{dI}{dt} < 0$]{style="color:blue;"}.
- Recall from the SIR model that [$\dfrac{dI}{dt} = \beta S I - \gamma I$]{style="color:blue;"}.
- Let's solve this equation at $t = 0$ by setting $I = 1$, assuming [$\dfrac{dI}{dt} < 0$]{style="color:blue;"}.
------------------------------------------------------------------------
At $t = 0$, we have
\begin{equation*}
\frac{dI}{dt} = \beta S I - \gamma I < 0 \end{equation*}
Factor out $I$, and we get
\begin{equation*}
I (\beta S - \gamma) < 0
\end{equation*}
------------------------------------------------------------------------
- Since at $t=0$$, I > 0$, we have [$S < \dfrac{\gamma}{\beta}$]{style="color:blue;"}.
- [$\dfrac{\gamma}{\beta}$]{style="color:blue;"} is the relative removal rate.
------------------------------------------------------------------------
- **Interpretation**:
- At $t = 0$, $S$ must be less than $\dfrac{\gamma}{\beta}$ for the epidemic to die out.
- If the rate of removal/recovery is greater than the transmission rate, the epidemic will die out.
- Any infection that cannot transmit to more than one host is going to die out.
------------------------------------------------------------------------
For the SIR model, the quantity [$\dfrac{\beta}{\gamma}$]{style="color:blue"} is called the [reproduction number, $R0$]{style="color:tomato"} (pronounced "R naught" or "R zero").
------------------------------------------------------------------------
#### The basic reproduction number, R0
- The basic reproduction number, [$R0$]{style="color:blue"}, is the average number of secondary infections generated by a [single primary infection]{style="color:tomato"} in a [completely susceptible]{style="color:tomato"} population.
- The basic reproduction number is a key quantity in infectious disease epidemiology.
------------------------------------------------------------------------
- It is often represented as a single number or a range of high-low values.
- For example, the $R0$ for measles is popularly known to be $12$ - $18$ [@guerra2017measlesR0].
------------------------------------------------------------------------
- $R0$ is often used to express the threshold phenomena in infectious disease epidemiology:
- If $R0 > 1$, the epidemic will grow.
- If $R0 < 1$, the epidemic will decline.
- A pathogen's $R0$ value is determined by biological characteristics of the pathogen and the host's behaviour.
------------------------------------------------------------------------
- Conceptually, $R0$ is given by
$$
R0 \propto \dfrac{\text{Infection}}{\text{Contact}} \times \dfrac{\text{Contact}}{\text{Time}} \times \dfrac{\text{Time}}{\text{Infection}}
$$
- $R0$ is unitless and dimensionless.
------------------------------------------------------------------------
### Numerical simulations
- Numerical simulations can be performed with any programming language.
- This course focuses on the R programming language because:
- It is a popular language for data analysis and statistical computing.
- It has a rich ecosystem of packages for solving differential equations.
- It is free and open-source.
------------------------------------------------------------------------
- In R, we can use the `{deSolve}` package to solve the differential equations.
- To solve the model in R with `{deSolve}`, we will always need to define at least three things:
- The model equations.
- The initial parameter values.
- The initial conditions (population sizes).
------------------------------------------------------------------------
#### Practicals
- Let's do a code walk through in R using the script `sir.Rmd`.
------------------------------------------------------------------------
::: {.callout-caution collapse="true" icon="false"}
#### Discussion
- What happens if we increase or decrease the value of $R0$?
- What happens if we increase or decrease the value of the infectious period?
- How can we flatten the curve?
:::
::: notes
- We can flatten the curve by reducing the value of $R0$.
- In reality, we can reduce $R0$ by implementing control measures such as social distancing, wearing masks, and vaccination.
- These control measures reduce the number of contacts between individuals or the probability of infection, which in turn reduces the transmission rate.
:::
------------------------------------------------------------------------