A model of how a disease moves through a city — accounting for a hidden (incubation) period. Change the parameters, introduce quarantine — and see what happens. Right in your browser.
Pick a disease and watch how it spreads.
Pick a scenario and see how different diseases behave differently.
Paste the number of sick people per day (one number per line, or "day,value") — the model will overlay a curve on it. "Fit β" will automatically find the best match.
RMSE is the model's average error in people: the smaller, the more accurate. If the curve still doesn't match even after fitting, something in real life isn't captured by the model.
The "Sample data" is synthetic (generated by the model with added noise) and calculated for a population of 100,000.
The idea is simple: everyone is divided into five groups and moves from one to another.
R₀ is how many people, on average, one infected person infects. Above 1 — the epidemic grows; below 1 — it dies out on its own. The more people who have already recovered (or died), the harder it is for the disease to find new victims, and the wave subsides.
N is the total number of people initially, β is the transmission rate, σ is the rate of leaving the hidden period (σ = 1 / length of hidden period), γ is the rate of leaving the infected group (recovery or death), CFR is the fatality rate (share of infected who die).
dS/dt = −β · S · I / (N−D)dE/dt = β · S · I / (N−D) − σ · EdI/dt = σ · E − γ · IdR/dt = γ · (1−CFR) · IdD/dt = γ · CFR · I R₀ = β / γ, γ = 1 / (infectious period), σ = 1 / (hidden period)
Infection is calculated based on the number of people still alive (N−D) — the deceased can neither get infected nor infect others. The epidemic dies out once immunity (recovered or died) covers a share of 1 − 1/R₀ of the population. At CFR = 100% and a sufficiently high R₀, (almost) the entire population can die out. The calculation uses the 4th-order Runge–Kutta method (RK4) with a step of 0.1 days.