How outbreaks grow, peak, and end
Lineages split (birth) and die (death) at random
Today: The same model, but the “lineages” are infections
| Birth-death | SIR | |
|---|---|---|
| What multiplies? | Lineages, \(n\) | Infections, \(I\) |
| Total rate of “births” | \(\lambda n\) | \(\beta \frac{S}{N} \cdot I\) |
| Total rate of “deaths” | \(\mu n\) | \(\gamma I\) |
At the start of an outbreak, \(S / N \approx 1\), so it is a birth-death process with \(\lambda = \beta\) and \(\mu = \gamma\)
The difference: Each infection “uses up” a susceptible person, so the outbreak slows down as \(S\) shrinks
\(R_0\): The average number of people one infected person infects, when everyone else is susceptible
Infects at rate \(\beta\), for an average of \(1 / \gamma\) days:
\[ R_0 = \frac{\beta}{\gamma} \]
Question
What do you think happens when \(R_0 < 1\)? When \(R_0 > 1\)?
Same recipe as simulate_birth_death, with different rates
\(N = 763\), one infected person, \(\beta = 1\), \(\gamma = 0.5\) per day (\(R_0 = 2\))
| \(R_0\) | Fraction of minor outbreaks (simulated) |
|---|---|
| 1.5 | 0.65 |
| 2.0 | 0.52 |
| 3.0 | 0.34 |
Question
Last time, a clade starting with one lineage eventually died out with probability \(\mu / \lambda\).1 What should the probability be here?
In a short time \(\Delta t\), the expected numbers of events are:
\[ \text{new infections} = \frac{\beta I S}{N} \Delta t \qquad \text{recoveries} = \gamma I \Delta t \]
Update, and repeat, one time step at a time:
\[ \begin{aligned} S &\leftarrow S - \text{new infections} \\ I &\leftarrow I + \text{new infections} - \text{recoveries} \\ R &\leftarrow R + \text{recoveries} \end{aligned} \]
Each infected person infects at rate \(\beta S / N\) and recovers at rate \(\gamma\)
Question
What is \(S / N\) when \(I\) stops growing? (You’ll find out in the capstone!)
For each \(\beta\) and \(\gamma\), how far are the predictions from the counts?
\[ \text{sum of squares} = \sum_{\text{days}} \left(\text{observed} - \text{predicted}\right)^2 \]
linregress in Capstone 2)Watch for
How contagious was this virus? And why did only 512 students end up in bed?
simulate_sir: The Gillespie algorithm for outbreaksfraction_minor_outbreaks: How often does an outbreak fizzle out?simulate_sir_euler and plot_sir: Explore the average outbreak, with sliderssum_of_squares and fit_sir: Fit the model to the boarding schoolI drafted and iterated on these slides in collaboration with Anthropic’s Claude (Opus 5.5 model).