Epidemiology
An outbreak, person by person
Every dot is a person. Blue can catch it, red has it, grey has recovered and is immune, green was vaccinated. The chart compares what the crowd actually does with what the textbook SIR model predicts for the same disease — and the two do not always agree.
The model
People wander a walled box. Anyone infectious can pass the infection to each susceptible person within a fixed distance, at a constant rate per day. Each infectious person recovers at a constant rate, so illnesses last a random time averaging the number of days in the controls panel, and recovery brings immunity for good. Time moves in tenths of a day.
Those are exactly the assumptions of the SIR model that William Kermack and Anderson McKendrick published in 1927 — with one exception. SIR assumes everybody is equally likely to meet everybody else, all the time. Here, people only meet whoever happens to be near them.
dS/dt = −βSI dI/dt = βSI − γI dR/dt = γI R₀ = β/γ
R₀ and herd immunity
The basic reproduction number R₀ is the average number of people one case infects in a population where nobody is immune. The simulator sets the infection rate so that, if everyone were spread evenly, each case would expect to infect R₀ others; that is the "well-mixed" R₀ the slider controls.
An outbreak grows while each case infects more than one other person. Once a share 1 − 1/R₀ of people are immune, each case infects fewer than one on average and the outbreak declines. That share is the herd immunity threshold, drawn as the green dotted line on the chart: 67% for R₀ = 3, 92% for R₀ = 12. Press "Vaccinate just past the threshold" and the outbreak fizzles, even though some people are still unprotected.
Note that in the SIR model an unchecked epidemic overshoots the threshold. Infections peak exactly when the susceptible share falls to 1/R₀, but people already infected keep infecting others on the way down, so far more than 1 − 1/R₀ are infected in the end: 94% for R₀ = 3.
Why the crowd and the formula differ
With everyone moving freely, the crowd follows the formula fairly closely. In test runs with R₀ = 3, about 87% of people were eventually infected, against the formula’s 94% — the people near the walls, and those who happen to keep to quiet corners, escape more often than SIR allows.
Turn mobility down and the gap widens fast. Each case can only infect its neighbours, and its neighbours have mostly been exposed already, so the outbreak spreads as a slow front instead of everywhere at once. At 30% mobility the same R₀ gave a peak about a third as high, almost a month later. Stop everyone moving and, at the starting density, there is no epidemic at all: each person has on average about half a neighbour within range, so chains of infection cannot connect up. (In two dimensions a still crowd only links up into one connected web at around four or five neighbours each.) That is the logic behind reducing contacts — it is the local structure of who meets whom, not just the average, that decides the outcome.
What it leaves out
A great deal: there is no incubation period (an SEIR model adds one), no age structure, no households or workplaces, no loss of immunity, no deaths, and no change in behaviour as cases rise. The presets are labelled by R₀ only; real diseases differ in far more than that. Use it to build intuition for why the numbers behave as they do, not to forecast anything.
References
- W. O. Kermack and A. G. McKendrick (1927), A contribution to the mathematical theory of epidemics, Proc. R. Soc. A.
- P. Fine, K. Eames and D. L. Heymann (2011), “Herd immunity”: a rough guide, Clinical Infectious Diseases.
- F. M. Guerra et al. (2017), The basic reproduction number (R₀) of measles: a systematic review, Lancet Infectious Diseases.
