Epidemic ModelingCore models

Module 4Spatio-temporal models

Epidemics happen in places. We link cities by travel (metapopulation models), put people on contact networks, let infection spread as a wave across continuous space, and use matrix norms to bound growth without solving everything. Along the way: effective distance, imported sparks, excess degree and hubs, clustering, wave speed, borders, long jumps, transient growth and the critical patch size.

By the end you should be able to build a metapopulation model and read its timing, compute an epidemic threshold on a contact network, estimate the speed of an epidemic wave, and use matrix norms to prove that an outbreak dies out.

Key ideas, one per episode

  • Ep. 13Travel decides when an epidemic arrives, not how big it gets; arrival follows effective distance, not the map.
  • Ep. 14On networks the threshold depends on excess degree: hubs lower it and speed spread, clustering slows it.
  • Ep. 15Reaction plus diffusion makes waves with speed 2√(D r); borders, drift and long jumps reshape them.
  • Ep. 16Any matrix norm below one proves an outbreak dies out; the spectral radius tells the long run, norms the short run.

Textbook: Chapter 4 of T. Lazebnik, Epidemic Modeling: Principles, Algorithms, and Applications (Academic Press, 2026). The episodes and slides follow the chapter’s topics in our own words, figures and simulations; nothing is copied from the book.

The title slide of Module 4: Spatio-temporal models

39 slides, written to be read on your own, with worked examples, “try it” boxes, our own small simulations and check-yourself questions (answers at the end). PDF, 1.0 MB.

Watch

4 short episodes for this module. Pick one from the list, and open the transcript to read along: each timestamp plays the episode from there. The narration is generated with a voice clone of Teddy, used with his permission.

Episode 13 · 5:42

Cities linked by travel

Space enters the model: cities linked by travel.

Travel decides when an epidemic arrives, not how big it gets; arrival follows effective distance, not the map.

TranscriptEpisode 13
0:00

When will it arrive?. An outbreak starts in one city. When does it reach the next city, and the one after that? Today, space enters the model, starting with cities linked by travel. And here's where we're heading: travel decides when an epidemic arrives far more than the map does.

0:22

Patches linked by travel. Split the map into patches: cities, districts, regions. Inside each patch, people mix well, so each patch runs its own S I R. Patches are linked by movement. A matrix M holds the travel rates: m p q is the share of patch p's people who travel to patch q each day. Travelers carry their state with them. A susceptible traveler arrives susceptible. An infected one arrives infected, and seeds the next city. This is the flux, or migration, form. People really relocate, and every compartment flows along the links. The total population stays the same; only where people are changes.

0:59

Moving people or moving risk. There's a second way to link patches. Most travel is commuting: people visit another city during the day and come home at night. Then we keep everyone at home and let infection pressure travel instead. The force of infection in patch p adds up contact with infected people from every patch, weighted by how much the two patches mix. Moving people, or moving risk. Pick the one that matches your data: migration records, or commuting and visit data.

1:25

Two clocks: growth and travel. Let's see what travel does. Five cities in a row, each with R₀ of three, each linked only to its neighbors. The first city has the outbreak. With very little travel, three people in ten thousand a day, the waves come one after another. The last city peaks on day one hundred thirty seven, eighty seven days after the first. With a lot of travel, one person in ten a day, all five cities peak within two days of each other, around day fifty eight. And either way, every city ends with about ninety four percent infected. Travel changes the timing, not the total. Two clocks are racing: how fast the epidemic grows inside a city, and how fast people move between cities. Weak travel gives a chain of local epidemics. Strong travel merges them into one.

2:09

Effective distance. Now a more realistic map: eight cities of different sizes. Travel falls off with distance, plus one air link between the two big cities. The outbreak starts in the big city on the left. Its nearest neighbor is reached on day twenty four. The other big city, near the far end, across the air link: day ten. Distance on the map explains almost none of the arrival times. R squared is 0.05. So measure distance by travel instead. Brockmann and Helbing defined an effective distance: one minus the log of the share of travelers going from one city to the next, added up along the best route. With effective distance, arrival times fall on a straight line: R squared of 0.99. The epidemic moves like a wave, in travel space, not on the map.

2:57

Imported sparks. Travel can also keep an outbreak going where it would die out alone. Take a small town where each case infects only 0.8 others. On its own, a few cases fizzle: less than half a percent of the town is ever infected. Now let one tenth of the town's contacts be with visitors from a big city, where R₀ is two. The town ends with thirty six percent infected. Locally, R₀ is below one, yet the town is hit hard, because sparks keep arriving. So don't only ask if R₀ is above one. Ask how often sparks arrive.

3:31

R0 of a network of patches. So what is R₀ for a whole network of patches? The next generation matrix from Module three answers it: the local reproduction numbers, combined through the mixing matrix. R₀ is its dominant eigenvalue. Take one hot city where each case infects 1.6 people, and four cool cities at 0.8. On its own, the hot city sustains an outbreak. Mix them, and the hot city's cases spend part of their contacts in cool cities. Mix half of all contacts, and R₀ falls to 1.1. Mix three quarters, and it reaches one. Now flip it. Five cities just below one, at 0.95. Turn one into a hotspot at 1.6, with thirty percent mixing, and the whole network goes above one, to 1.27. One hotspot can carry a region.

4:18

Border closures. Real models add more: different parameters per city, so some cities export infection and others import it; commuting that differs on weekdays and weekends; and travel that changes over time. Like a border closure. Two cities linked by travel. Cut the travel to one twentieth on day seven, and the second city's outbreak arrives four days later, and peaks a week later. Cut it on day zero, and the peak comes two weeks later. Cut it on day twenty, after the virus has arrived, and it buys three days. And every time, the second city still ends with ninety four percent infected. A closure buys time: to prepare, to treat, to vaccinate. It doesn't buy immunity.

5:00

Recap. So: patches with their own S I R, linked by travel. Weak links give a chain of waves; strong links synchronize them. Arrival follows effective distance, and imported sparks can keep places burning that couldn't burn on their own. Next time, we zoom in from cities to people: epidemics on networks of contacts.

Interactive lab

Cities, travel and networks

Change how much people travel between five cities and when a border closes, then compare how often outbreaks take off on three kinds of contact network.

The cities panel solves a metapopulation SIR model as you move the sliders; the network panel builds a 400-person network and runs exact random-event SIR outbreaks on it, in your browser.

Simple math

Space in two ways

Five cities on a line, linked by travel; then 400 people on a contact network. Both run in your browser.

Cities
dIₚ/dt = β SₚIₚ/Nₚ − γ Iₚ + m Σ (neighbour I − Iₚ)

Each city runs SIR (γ = 1/10 per day); a share m of people moves to each neighbouring city per day, carrying their state.

Networks
T = τ / (τ + γ)

T is the chance an edge transmits before the infected end recovers. A large outbreak needs T × mean excess degree above 1.

Closure
m → m / 20 from the closure day

Cutting travel delays the wave in the far cities; it does not change how many get infected in the end.

City 5 reached
–
First to last peak
–
City 5 infected in the end
–
Peak moved by closure
–

Solving…

Infected now, city by city

City 1 orange, then amber, green, blue and grey along the line.

Challenges

Each one is checked on your current settings, here or in the network panel below.

  1. Make the last city peak at least 80 days after the first.
  2. With travel at 1 in 100 per day, use a closure to push city 5’s peak at least 15 days later.
  3. With T = 0.30, pick a network where fewer than 10% of runs take off.
Runs that take off (≥ 5%)
–
Their average size
–
Threshold 1 / excess degree
–
Clustering
–

Running…

Final sizes

How many runs ended at each share infected (5% bins); green: runs that fizzled.