OpenWorldLab

Loading interactive view…

Epidemiology

An outbreak, person by person

Every dot is a person. Blue can catch the disease, red has it, grey has recovered and is immune, and green was vaccinated. The chart compares what the crowd does with what the textbook SIR model (susceptible, infectious, recovered) predicts for the same disease. 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 an illness lasts a random time that averages the number of days set in the controls panel. Recovery brings immunity for good. Time moves in tenths of a day.

These are 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. In the equations, S, I and R are the shares of people who are susceptible, infectious and recovered, β is the infection rate and γ the recovery rate.

dSdt=−βSIdIdt=βSI−γIdRdt=γIR0=βγ\frac{dS}{dt} = -\beta S I \qquad \frac{dI}{dt} = \beta S I - \gamma I \qquad \frac{dR}{dt} = \gamma I \qquad R_0 = \frac{\beta}{\gamma}

R₀ and herd immunity

The basic reproduction number R₀ is the average number of people one case infects when nobody is immune. The simulator sets the infection rate so that, if everyone were spread evenly, each case would infect R₀ others on average. 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.

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: the outcome depends on who meets whom nearby, as well as on the average number of contacts.

What it leaves out

A great deal. There is no incubation period (an SEIR model adds one, as an “exposed” stage), 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 see why the numbers behave as they do. It cannot forecast a real outbreak.

References