When a disease is spreading through a population, the SIR model puts individuals into one of three categories:
- Susceptible - the individual who has not yet caught the disease
- Infectious - an individual is sick and may spread the disease to susceptible individuals
- Removed - sometimes called Recovered - these individuals were previously infectious, and either have recovered and are now immune, or have died. Either way they can not get the disease again or infect susceptible individuals.
We'll look at a simple SIR model called the Kermack-McKendrick Model.
There are two parameters in the model:
b
: the number of interactions each day that could spread the disease (per individual)k
: the fraction of the infectious population which recovers each day
To implement an agent-based model, you might have a class which represents a person, with an internal state which is one of S
, I
, or R
. You would then simulate a population, where people interact and change state according to the model parameters.
In the ODE simulation, you will model time dependent variables: S, I, R
which represent the total number of individuals in each population (if the total population has N
individuals, then S + I + R = N
at all times), as well as s, i, r
, the fraction of each population in the total population, e.g. s(t) = S(t) / N
(i.e. s + i + r = 1
at all times).
If we pass to continuous limits, we can get the following system of differential equations:
ds/dt = -b * s(t) * i(t)
dr/dt = k * i(t)
di/dt = b * s(t) * i(t) - k * i(t)
Equation 1 captures how susceptible people are made sick by infectious people by interacting with parameterb
. Equation 2 captures how infectious people enter the removed population at ratek
. Equation 3 captures how susceptible people become infected, and infectious people are removed. See this MAA article for some additional details on the derivation.