Adding Realism
How Epidemics Spread
Chapter 5 · Adding Realism
The model in How Epidemics Spread 3 had three boxes, and How Epidemics Spread 4 used it to find the herd immunity threshold. Real outbreaks break its rules in familiar ways. People are infected a few days before they can infect anyone else. Some die. Immunity can fade. Babies are born, and each new baby is a fresh susceptible. This chapter adds those four things one at a time and watches what each does. Two lessons emerge: some changes alter only the timing of an epidemic, and some change the long-run outcome, including the possibility that a disease never leaves and becomes endemic.
A Latent Period: the E Box
After catching a disease, a person is usually not infectious straight away. The Wikipedia article notes that SEIS and SEIR models include a latent period during which the person is not infectious. The extra compartment is called E, for exposed, and the model is called SEIR: people move S to E at the infection rate (exactly as before), then E to I at a rate σ = 1 / (latent period), then I to R at γ. The code below runs R0 = 2.5 with a 5-day infectious period and latent periods of 0 (the plain SIR of earlier chapters), 2, 4 and 8 days, and reports the day of the peak, the peak number infectious, and the share ever infected. The step is 0.05 days, and this is just numerical stepping, no calculus.
The final size is the same in all four runs: 89.3 per cent, the figure for R0 = 2.5 in How Epidemics Spread 3 and How Epidemics Spread 4. What changes is the schedule. A latent period of 8 days moves the peak from day 32 to day 102 and cuts the peak number infectious from 2,343 to 886. In these runs R0 is untouched (it is still β/γ, the number of people one case infects), but each step along the chain now takes longer, so the epidemic grows more slowly, spreads the same total over a longer time, and at any instant fewer people are infectious (many are waiting in E). That is my reading of the output, not a result from the article. Reading for practice: the same number of eventual cases can mean a very different load at the peak, which is why timing matters for hospitals.
| SIR (How Epidemics Spread 3) | SEIR (this chapter) | |
|---|---|---|
| Compartments | S, I, R | S, E, I, R |
| Path of a case | infected and infectious at once | infected, wait (latent), then infectious |
| Peak day (R0 = 2.5) | day 32 | day 55 / 72 / 102 for 2 / 4 / 8 days latent |
| Final share infected | 89.3% | 89.3% in each of those runs |
| Best for | diseases with little delay | diseases with an incubation gap before infectiousness |
Adding Deaths
So far people left the infectious stage into R and the population stayed the same size. A simple way to add deaths is to say that a share f of the people leaving the infectious stage die rather than recover. The code does that, with the SEIR rules above (3-day latent, 5-day infectious). It also divides by the number still alive when working out how often a susceptible meets an infectious person. That is a modelling choice, assumed. The fatality shares 0.1, 1 and 5 per cent are illustrative.
Deaths scale almost directly with f: 8.9, 89.5 and 450.2 per 10,000. The share ever infected barely moves (89.3, 89.5 and 90.0 per cent). The 90.0 comes from my choice to divide by the survivors: as people die, each remaining susceptible meets a slightly larger share of infectious people, so a few more get infected. The point is that this kind of death changes the toll but hardly the course of the epidemic. It is also a different thing from a deadly disease that kills people before they can infect others, which would shorten the infectious period and so lower R0, an effect not modelled here.
Births, Waning Immunity and the Endemic State
The big change comes from a longer horizon. Over decades, people are born and die for other reasons too. The article's version of the model has a birth rate and a death rate; with them, R0 becomes β/(μ + γ), because people leave the infectious state by dying as well as recovering. It gives two long-run outcomes: if R0 is 1 or less, the disease dies out and the population returns to the all-susceptible, disease-free state; if R0 is above 1 and some infection is present, the system tends to an endemic state in which the disease stays permanently, with the susceptible share settling at (γ + μ)/β, which is 1/R0. The disease stays because births keep refilling S.
The code compares two worlds with R0 = 2.5, a population of 1,000,000 and people living on average 70 years (birth rate equal to death rate, so the population stays constant). In the first, immunity lasts for life, so only births refill S. In the second, immunity wanes: recovered people return to S after 2 years on average, giving the SIRS model (mentioned briefly in the article, with no equations in the portion I saw). It prints, for each 25-year window, the lowest, highest and mean number infectious per 100,000, plus the endemic level my algebra predicts. Setting the rates of change to zero and solving is just algebra: for births only it gives μ(R0 − 1)/β, the article’s endemic infectious share; with waning ω, it gives (1 − 1/R0) / (1 + γ/(μ + ω)).
The two worlds behave very differently. With waning immunity the system settles within 25 years at 419.8 infectious per 100,000, a steady background level that matches the formula (419.7) and keeps the susceptible share at exactly 1/R0 = 0.400. With lifelong immunity the disease does not settle quickly. The first wave peaks at 17,832.6 per 100,000, and then infection fades to a lowest and highest of under 0.0005 per 100,000 in the years 25 to 49, which in a population of one million is far less than a single person. Only as births rebuild S does it rebound (to 4,139.7, then 1,842.7, 1,041.6 and 669.3 per 100,000 in later windows). The waves shrink and slowly home in on the formula’s 11.7 per 100,000 (the final-window mean is 14.9 and the susceptible share has reached 0.346, not yet 0.400).
The deterministic model keeps a vanishing fraction of a person infected and lets the disease recover from it. A real population has whole people. My inference (not a result from the article) is that those deep troughs would end in real extinction, with the disease coming back only if someone brought it in from outside. This is where chance matters, and How Epidemics Spread 6 is about it.
| Epidemic (earlier chapters) | Endemic (this chapter) | |
|---|---|---|
| Time scale | weeks to months | years to decades |
| Susceptible supply | only the starting population | refilled by births and by waning immunity |
| Long-run susceptible share | falls and stays low | settles near 1/R0 (0.400 for R0 = 2.5) |
| Shape | one wave, then it ends | waves that shrink, or a steady background level |
| Effective reproduction number | falls below 1 as S falls | hovers around 1 (R0 × S/N = 1 at the endemic state) |
Why Vaccination Looks Different in an Endemic World
How Epidemics Spread 4 vaccinated people before one outbreak. When births keep arriving, vaccination has to be an ongoing programme, and the same threshold appears in a new form: if a share p of newborns is protected, the formula for the endemic level becomes μ(R0(1 − p) − 1)/β, which falls to zero when p reaches 1 − 1/R0. This is my own derivation, checked by Exercise 3. Notice how a plain 1 − 1/R0 still governs elimination, but here it applies to each new generation of susceptibles.
Run the SEIR model with R0 = 3 (assumed) and latent periods of 2, 4 and 8 days with a 5-day infectious period, population 10,000. Print the day of the peak, the peak number infectious and the share ever infected for each, and say which of the three numbers changes with the latent period and which does not.
📄 View solutionUsing the SIRS model with births in a population of 1,000,000 (R0 = 2.5, 70-year lifetime, assumed), let immunity last 0.5, 1 and 3 years. Simulate 60 years and compare the infectious level per 100,000 at the end with the formula (1 − 1/R0) / (1 + γ/(μ + ω)).
📄 View solutionStart from the unvaccinated endemic state (R0 = 2.5, lifelong immunity, assumed). Switch on a perfect vaccine for 0, 30, 50, 60 and 70 per cent of newborns, run 100 years, and compare the final infectious level per 100,000 with the prediction μ(R0(1 − p) − 1)/β. Which coverages eliminate the disease?
📄 View solutionQuick Reference
- SEIR: S to E at the infection rate, E to I at σ = 1 / latent period, I to R at γ
- Latent period effect: later and lower peak; final size unchanged in these runs (R0 = 2.5: 89.3%)
- Deaths: a share f leaves I by dying; the toll scales with f, the epidemic barely changes
- With births and deaths: R0 = β/(μ + γ); disease dies out if R0 ≤ 1, otherwise tends to an endemic state
- Endemic state: susceptible share (γ + μ)/β = 1/R0; infectious share μ(R0 − 1)/β with lifelong immunity
- SIRS (waning ω): infectious share (1 − 1/R0) / (1 + γ/(μ + ω))
- Newborn vaccination p: level μ(R0(1 − p) − 1)/β, zero once p ≥ 1 − 1/R0
- Assumes: well-mixed population, constant rates, illustrative numbers