John M. Drake
Steps in developing a model
Objective: A running example to illustrate compartmental modeling
Note the idealizations
A classic model for an acute immunizing infection that classified individuals according to infection status
These quantities will be our state variables
First studied extensively by Kermack & McKendrick (1927) A Contribution to the Mathematical Theory of Epidemics. Proceedings of the Royal Society of London. Series A 115 (772): 700–721
Determined by pathology/immunology
Transmission systems
Structure
The kinetics of the model are determined by flows between the compartments which are mathematically represented by rates of change
Flows depend on characteristics of the host population and the pathogen biology and include things like contact rates among hosts, and pathogen infectivity. These variables are our model parameters.
Assign each state variable a unique variable (typically a Roman letter)
Assign parameters a unique variable (typically a Greek letter)
Note: Notation varies among authors; one should not assume that a symbol used in two different papers means the same in each.
Sum the positive and negative flows that affect each state variable
\[ \begin{aligned} \frac{dX}{dt} &= - \beta XY \\ \frac{dY}{dt} &= \beta XY - \gamma Y \\ \frac{dZ}{dt} &= \gamma Y \end{aligned} \]
Note: These equations can also be derived using difference quotients and the fundamental theorem of calculus. I find it more straightforward to think in terms of flows.
Note: Sometimes “overdot notation” is used to signifiy time derivatives, i.e. \( \dot{X} = \frac{dX}{dt} \).
It is common to think of the rate at which susceptibles become infected as caused by a force acting on each susceptible individually.
This force of infection, which we might denote by \( \lambda \), may be identifed by factoring the \( X \) out of our equation for \( \frac{dX}{dt} \), i.e.
\[ \begin{aligned} \frac{dX}{dt} &= - \beta XY \\ &= - (\beta Y) \times X \\ &= - \lambda \times X \\ \end{aligned} \]
The force of infection may take many different forms depending on the conditions under which transmission occurs. A common distinction is between density dependent transmission (\( \lambda = \beta Y \)) and frequency dependent transmission (\( \lambda = \beta \frac{Y}{N} \), where \( N = X+Y+Z \) is the total population size).
If the population size does not change (i.e. \( N \) is a constant) then these two models differ only by the units of \( \beta \). However, if the population size does change (for instance due to disease-induced mortality) then these two forces of infection result in very different dynamical outcomes.
Assume an infectious individual arises in a Wholly Susceptible and otherwise Disease Free population with frequency-dependent transmission
Initial conditions: \( X(0)=N-1 \approx N \), \( Y(0)=1 \), and \( Z(0)=0 \)
Invasion occurs only if \( dY/dt > 0 \)
\[ \begin{align} \frac{dY}{dt} = \beta X Y/N - \gamma Y &> 0 \\ Y(\beta X/N - \gamma) &>0 \\ X/N &> \gamma/\beta \end{align} \]
Since \( X \approx N \), this is satisfied when \( 1>\gamma / \beta \), which is equivalent to \( \beta/\gamma > 1 \)
Kermack & McKendrick (1927)
\( \beta \) | \( 1/\gamma \) | \( R_0 \) | |
---|---|---|---|
Measles | 886/yr | 0.019 yr | 17 |
Influenza | 180/yr | 0.011 yr | 2 |
Chicken pox | 315/yr | 0.022 yr | 7 |
Rubella | 200/yr | 0.025 yr | 5 |
We assume infectious individuals die at rate \( \alpha \)
\[ \frac{dY}{dt} = ... -\gamma Y - \alpha Y \]
When we talk about “solving” a model we mean that we want to know what the state of the system will be at a future time given the system equations and some initial conditions, requiring integration of the equations. These are also known as boundary value problems.
Systems of nonlinear differential equations (like the \( SIR \) model) are typically not analytically tractable, although clever mathematicians have found numerous approximations or special cases, like the final size relation.
\[ 1-R(\infty)-e^{-R(\infty)R_0} \]
Thus, we use numerical algorithms such as the 4th order Runge-Kutta algorithm to take advantage of Euler's approximation to obtain an approximate solution by solving a sequence of tractable linear approximations at smaller and smaller step sizes until a specified tolerance is achieved.
In R, numerical integration of ordinary differential equations is readily performed using the package deSolve
. Particularly, the function ode
is useful since it automatically selects the optimal solving algorithm based on numerical performance.
Modelers must be cautious, however, and alert to seeming anomalous results resulting from numerical instabilities.
Presentations and exercises draw significantly from materials developed with Pej Rohani, Ben Bolker, Matt Ferrari, Aaron King, and Dave Smith used during the 2009-2011 Ecology and Evolution of Infectious Diseases workshops and the 2009-2019 Summer Institutes in Statistics and Modeling of Infectious Diseases.
Licensed under the Creative Commons attribution-noncommercial license, http://creativecommons.org/licenses/bync/3.0/. Please share and remix noncommercially, mentioning its origin.