Simulating epidemics

Below you see a simulation of an epidemic. You can adjust the characteristics of the disease, and the characteristics of human behavior, to see how these affect the course of the epidemic. For example, consider an infection which lasts for 5 days, and which has a 3% probability of transmission. If people have 10 meetings per day, half of the global population will become infected. But if people reduced their interactions to just 6 per day, the epidemic could never even started!

Max infectious: . Min susceptible: .

This is an “SIR model”. “SIR” stands for “Susceptible, Infected, Recovered”. We have a constant population where each person is in one of these three states. Each day, some susceptible people become infected by meeting infectious people, and some infected people recover.

The SIR model is simplistic! Most obviously, it doesn’t account for location or networks; all meetings are between two random members of the global population. This is a limitation of all “compartmental models”. And the “states” in the SIR model are also simplistic. They don’t account for an incubation period, or for loss of immunity, or for carrier status, or for death (perhaps the most important state we care about!).

And yet the SIR model shows some important things about epidemics. It shows that the outcome is very sensitive to inputs. I mentioned one at the start: a moderate reduction in the number of meetings can be the difference between a pandemic and an isolated case. Similarly, if we reduced transmission probability from 3% to 2%, perhaps by wearing masks, the epidemic would never get started. Exponential growth is very sensitive to the exponent!

But the SIR model also shows that the epidemic won’t reach the whole population. As people become immune, the exponent drops below 1, because meetings between infected and susceptible people become less likely. In the simulation above, 40% of the population remain susceptible, but the epidemic died before it could reach them.

I just released Vidrio, a free app for macOS and Windows to make your screen-sharing awesomely holographic. Vidrio shows your webcam video on your screen, just like a mirror. Then you just share or record your screen with Zoom, QuickTime, or any other app. Vidrio makes your presentations effortlessly engaging, showing your gestures, gazes, and expressions. #1 on Product Hunt. Available for macOS and Windows.

With Vidrio

With generic competitor

More by Jim

Tagged #programming, #epidemiology. All content copyright James Fisher 2020. This post is not associated with my employer. Found an error? Edit this page.