Outbreak Chains

Educational stochastic model. Not for forecasting, clinical or public-health decisions. Parameters are illustrative.
infectiousisolated: detectedisolated: traced forwardisolated: source foundisolated: clusterpast infectious windowdiamond = isolatedwire cage = 6+ new cases
Loading the town...
Town → Engine → Ensemble

Settings

High is the default on every device. Low is a manual choice (also ?q=low). Status colours are colour-vision-safe and are backed by shapes and labels.

Guided experiments

Each one runs the model and compares the result with the exact theory. "Reproduced" means inside the stated tolerance.

The science

1. What R means, and why it is not enough

Each case infects Z new cases; the mean is E[Z] = R. Below R = 1 chains are finite (mean total size 1/(1-R)); at R = 1 they are critical (size tail ~ n^-3/2); above R = 1 a chain can still die out by chance.

2. Dispersion k and the negative binomial

Individual infectiousness nu ~ Gamma(shape k, scale R/k), offspring Z | nu ~ Poisson(nu), so Z ~ NegBin(mean R, variance R + R^2/k). Small k = very uneven spread: most cases infect nobody, a few infect many. k to infinity is the Poisson case. Superspreading is a property of this distribution, not of any person.

3. Chance of dying out: q = G(q)

Generating function G(s) = (1 + R(1-s)/k)^-k (Poisson: exp(-R(1-s))). The extinction probability from one case is the smallest root of q = G(q) (q = 1 if R ≤ 1). From n starting cases the chance of a large outbreak is 1 - q^n. Example R = 2.5: q = 0.107 for k = infinity, 0.795 for k = 0.16.

4. Size of a chain

Total progeny from n0 cases (Dwass / Otter): P(N = n) = (n0/n) P(S_n = n - n0) with S_n ~ NegBin(mean nR, shape nk). For n0 = 1 this is the Blumberg and Lloyd-Smith closed form.

5. Who causes the spread: the top 10 %

Rank cases by offspring; the share of all transmissions from the top 10 % is exact for the negative binomial: 22.5 %, 37.3 %, 47.1 %, 71.1 %, 81.9 % for k = infinity, 1, 0.5, 0.16, 0.1 (R = 2.5).

6. Timing

Generation time ~ Gamma(mean 5.2 d, SD 1.7 d) and incubation ~ lognormal (median 5.1 d, sigma 0.42): published estimates for one respiratory virus (Ganyani et al. 2020; Lauer et al. 2020), used here as one illustrative setting, not a property of every disease. The simulator is event driven, so there is no time step and no discretisation error; the only error is sampling error, SE = sqrt(p(1-p)/n), shown as Wilson 95 % intervals.

7. Isolation and tracing (operational definitions)

A case is detected with probability p_d, tau_d days after symptoms, and isolated: each of its not-yet-realised children is cancelled with probability epsilon. Forward: each child infected before the detection is found with probability p_t after tau_t. Backward: with probability p_t the source is found after tau_t and isolated, and its other already-infected children (the cluster) are each found with probability p_t after a further tau_t. Backward tracing starts only from detected cases. Every case found by tracing is itself forward-traced in turn (chained tracing, as in Endo et al. 2020 and Hellewell et al. 2020); the v1 build did not chain, which is why its first E4 run showed no backward advantage. Rule of thumb: instant isolation of a fraction p gives R_eff = R(1-p), critical p* = 1 - 1/R.

8. Live checks (B1-B7)

Open the "Checks" tab to re-run seven independent comparisons between the simulator and closed-form or recomputed values. The same code runs in the Node test-suite.

9. Model limits (what is NOT captured)
10. Sources & verification

Checked against the papers on 2026-10-25:

Value herePublished number and source
k = 0.16 ("uneven spread" preset)0.16, 90 % CI 0.11-0.64 (Lloyd-Smith et al. 2005); also the value used by Hellewell et al. 2020
k ~ 0.1, check B7 (top 10 % -> ~80 %)k ~ 0.1 (95 % CrI 0.05-0.2) at R0 = 2.5; ~80 % of secondary transmissions from ~10 % of cases (Endo et al. 2020a)
Generation time Gamma 5.2 d, SD 1.7 d5.20 d (95 % CrI 3.78-6.78), SD 1.72 d (Ganyani et al. 2020)
Incubation lognormal, median 5.1 d, sigma 0.42median 5.1 d (95 % CI 4.5-5.8), dispersion 1.52 = e^0.42; 97.5 % within 11.5 d (Lauer et al. 2020)
"Flu-like" preset R = 1.3median R 1.28 (IQR 1.19-1.37) for seasonal flu-like epidemics (Biggerstaff et al. 2014); k = 1 is a model choice
"Very high R" preset R = 12illustrative; R0 of 12-18 is "often cited" for the most contagious childhood infections, with wide variation between studies (Guerra et al. 2017)
epsilon 0.9, cap 3000, 84 dmodel values; Hellewell et al. 2020 assumed 100 % effective isolation, a 5000-case cap and a 12-week horizon
Forward vs backward (E4)adding backward to forward tracing raises the share of cases averted ~2-3x, more with stronger overdispersion (Endo et al. 2020b); backward tracing also wins on heterogeneous contact networks (Kojaku et al. 2021). Reproduced here only when tracing is fast.

Lloyd-Smith J.O. et al. 2005 Nature 438:355-359; Endo A. et al. 2020a Wellcome Open Res 5:67; Endo A. et al. 2020b Wellcome Open Res 5:239 (backward tracing); Hellewell J. et al. 2020 Lancet Glob Health 8:e488-e496; Ganyani T. et al. 2020 Euro Surveill 25(17):2000257; Lauer S.A. et al. 2020 Ann Intern Med 172:577; Biggerstaff M. et al. 2014 BMC Infect Dis 14:480; Guerra F.M. et al. 2017 Lancet Infect Dis 17:e420-e428; Kojaku S. et al. 2021 Nat Phys 17:652-658; Blumberg S., Lloyd-Smith J.O. 2013 PLoS Comput Biol 9:e1002993; Kucharski A.J. et al. 2020 Lancet Infect Dis 20:1151-1160; Ferretti L. et al. 2020 Science 368:eabb6936; Kretzschmar M.E. et al. 2020 Lancet Public Health 5:e452-e459; Fraser C. et al. 2004 PNAS 101:6146-6151; Wallinga J., Lipsitch M. 2007 Proc R Soc B 274:599-604; Harris T.E. 1963 The Theory of Branching Processes; Keeling M.J., Rohani P. 2008 Modeling Infectious Diseases.

11. Disclaimer

Educational stochastic model. It is not a forecasting tool and must not be used for clinical or public-health decisions. No real events, places or people are depicted. Town models by this site's Blender pipeline, rendered with Three.js.

Made with 🟠 Blender · Three.js