This page describes a Markov chain model for the spread of an infectious disease in a population, inspired by “S-I-R-D” models. The model is implemented in Python and R programs which you can read and run, see the links below. You can also edit the parameters of the models and re-run the programs to see how the curves will change. This is the main benefit of the models, you can see how changes to the parameters result in changes to the infection curves.
This page describes a time-dependent model. If it is too complicated, step back to the simple model. If you want to see the effect of vaccination and loss of immunity, see the full model.
We model how the percentage of the population that is Susceptible, Infectious, Recovered, and Dead changes over time. The key parameters of the model are:
b, which is the probability that an infectious person is still infectious the next day
c, the percentage of people who get infected who die, also called the infection fatality rate
d, the average number of encounters each person in the population has with other people per day
e, the probability of getting infected when encountering an infectious person; note that only the product d*e matters, not the individual values of d and e
The Python program https://repl.it/@clzirbel/SIRDmodelTimeDependent and the R program https://repl.it/@clzirbel/SIRDmodelTimeDependentR do the calculations for the model and make graphs of the percentages of the population that is Susceptible, Infectious, Recovered, and Dead. You can click the link, run the program, edit the parameters, run the program again. The main value of the program is to see how changing the parameters changes the height of the infectious curve and the length of the epidemic. The programs should not be used to try to make numerical predictions of how many people will be Infectious or Recovered on any particular day.
The model uses the parameters above to set probabilities of each person in the population changing from one state to another each day. The probability of a Susceptible person becoming Infectious is proportional to the proportion of the population that is Infectious. The daily probability of a Susceptible person becoming Infectious is equal to d*e*mu[1]. The number d represents the average number of people from the population encountered per day, and e represents the probability of getting an infection from encountering an Infectious person. Reducing d or e flattens the curve and delays the peak. Note that the model is simple: it assumes that the d people you encounter per day are randomly chosen from the entire population. Or, equivalently, that the people you do encounter have the same probability of being infected as in the general population. So no place is assumed to be more or less safe than any other place. Below is the graph when each person encounters 5 people per day and there is a 3% chance of getting the infection from encountering Infectious person. The infection fatality rate is 0.0115, or 1.15% of people who get infected die. Some information from the R program:
Average number of people that each Infectious person infects is 2.2500
Maximum percentage infectious at one time was 19.8879% on day 117
Epidemic infection proportion 0.0100 started on day 58 and lasted 144 days until day 202
At the end of the simulation, the percentage of the population that has died from the infection is 0.0099%
You’d like to reduce the values of d and e. In fact, if you reduce d and e enough, the infection dies out! That would be nice. But during a pandemic, the infection rate is not generally going to zero, so the real parameters that are in effect are allowing the infection to spread. In addition to producing graphs, the programs display the maximum percentage of the population that is Infectious over the course of a year and on what day that happens.
You can explore the effect of changes that happen at regular intervals, for example, a model in which people encounter many more people than usual each Sunday. That could happen, for example, if enough churches open and that increases the average number of encounters. See https://repl.it/@clzirbel/SIRDmodelTimeDependentChurch for a program that has a different average number of encounters every 7th day. (One can also interpret this as what happens if people go out to bars every Friday night, for example.) Increasing the average number of encounters from 5 per day to 15 per day just one one day of the week raises the peak infection rate from 19.9% to 30.3%. On the other hand, it shortens the length of the intense part of the outbreak from 144 to 118 days. See the graph below.