Only a share of infections is reported, after a delay (here a gamma distribution).
Epidemic ModelingData and inference
Module 9Surveillance, mobility and genomic data
What the data streams see, and what they miss. In a simulated city with a known epidemic, we treat surveillance as a measurement process (delays, a reporting share that changes), correct serosurveys for imperfect tests, see how phone-based mobility data can mislead, use genomes to follow a new variant and the bias in which samples get sequenced, and read wastewater, search and pharmacy signals, then combine the streams.
Key ideas, one per episode
- Ep. 38Cases are infections seen through delays and a changing reporting share; correct serosurveys for test errors; phone data count only the phones they see.
- Ep. 39Fifty genomes a week found a new variant around day 31, five hundred around day 10; a constant sampling bias distorts its share, not its growth.
- Ep. 40Wastewater turned 6 to 9 days before reported cases and ignored a testing cut; combining streams beat any one alone.
Textbook: Chapter 9 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.
Watch
3 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 38 · 3:17
Surveillance as measurement, and mobility data
Surveillance as a measurement process: reporting delays and a changing reporting share, why cases can fall while infections rise, correcting serosurveys for imperfect tests, and how phone-based mobility data can mislead.
Cases are infections seen through delays and a changing reporting share; correct serosurveys for test errors; phone data count only the phones they see.
TranscriptEpisode 38
The end of a pipeline. A case count is not a thermometer reading of the epidemic. It's the end of a long pipeline. Welcome to Module nine: the data streams, and what each one really sees.
Infections and cases. Our simulated city has a million people, an epidemic, a lockdown on day sixty two and a relaxation on day one hundred ten. We know every infection: seventy one thousand in all. An infection becomes a case only if someone notices: symptoms after about five days, then a test and a report about four days later. Cases arrive eight days after infection on average, and only a share is ever found. That share changes. Here testing grew from fifteen to thirty five percent of infections, and then a policy change on day one hundred fifty cut it to twenty. Overall, only twenty two percent of infections became cases.
When testing changes. Watch what the policy change does. In the week after it, infections grew by more than two percent a day, while cases fell by about one percent a day. For eleven days, cases fell while infections rose. So model the measurement: write the infections, then the delays and the reporting share that turn them into data.
Serosurveys. Serosurveys measure past infection directly: test a random sample for antibodies. But tests make mistakes. With ninety percent sensitivity and ninety eight and a half percent specificity, false positives dominate when few people are truly positive. On day forty, when only 0.03 percent had been infected, a survey of two thousand people would find about one and a half percent positive: fifty times too many. The standard correction subtracts the false positive rate. Then it divides by the sum of sensitivity and specificity, minus one. On day one hundred ninety, corrected surveys ranged from 3.9 to 5.8 percent, around the truth of 4.8. Cases alone said 1.4.
Mobility data. Mobility data tell us how places connect: who travels where, and who mixes with whom. Phone data are the richest source, but they count only the phones they see. Our test: an outbreak starts in a small town whose residents make a thousand trips a day to the city. Only eight percent of the town's people use the phone company that shares data, against twenty eight percent nationally. Scaled up, the data show two hundred eighty trips. With the true flows, the city passes one infectious person per ten thousand on day twenty seven. With the phone flows, the model says day thirty two: five days of warning that don't exist. And a drop in visits is not the same as a drop in contacts: the link between them has to be estimated. Treat mobility as an input with its own uncertainty, and protect the privacy of the people behind it.
Next. Next: genomes. How sequences reveal new variants, and how sampling shapes what they can tell us.
What genomes add. Counts tell you how many. Genomes tell you how infections are related: new introductions, local spread, and new variants.
Sequencing as an observation model. From a patient sample to a lineage takes a pipeline: sequencing reads, alignment to a reference, a consensus genome, and a place on the family tree. Each step can fail, or bias what survives. And which samples get sequenced is an observation model of its own. The number of genomes depends on infections, but also on lab capacity, and on who decides what to sequence. In our city, labs sequence ten percent of cases, at most eighty a week. For seven weeks around the peak the cap was binding: in the busiest week, only six percent of cases were sequenced.
Lineage frequencies. Lineage frequencies are the workhorse. Suppose a new variant grows seven percent a day faster than the rest, on the log odds of its share, starting from one infection in a thousand. After eight weeks it's still under five percent of infections. Sequence fifty random cases a week, and the first variant genome typically turns up around day thirty one. Sequence five hundred a week, and around day ten. Now estimate its advantage from eight weeks of data. With fifty genomes a week, the ninety percent range was huge: 0.01 at the bottom, 0.41 at the top. With five hundred genomes a week, it tightened to between 0.05 and 0.09, around the true value of 0.07.
Biased sampling. Next, bias the sampling. Suppose travelers' samples are sequenced first, so the variant is three times as likely to be sequenced. Its share looks like ten percent when it's really about four. Yet the estimated advantage stays at 0.07: a constant bias shifts the log odds, not their slope. If the targeting starts halfway through, though, the advantage comes out at 0.09, about a quarter too high. So know how the samples were chosen, and keep that choice constant, or model it.
Beyond frequencies. Genomes can do more: count separate introductions, tell local spread from new seeding, and date when lineages arose. Those methods build transmission trees, and they need the same care about sampling.
Next. Next: signals from beyond the clinic. Wastewater, searches, and pharmacy sales.
Beyond the clinic. Not everyone who's infected sees a doctor. But almost everyone uses a toilet. Signals from beyond the clinic can see what testing misses.
Wastewater. Wastewater first. Infected people shed viral genetic material into sewage, starting soon after infection. What reaches the treatment plant is the shedding of all infections combined, diluted by the flow. In our city, shedding peaks around six days after infection, samples come in three times a week, measurements are noisy, and on twenty seven rainy days the extra water dilutes everything. Dividing by a fecal marker, which the rain dilutes in the same way, corrects for the flow. Here it trimmed the error of the wastewater growth rate by about seven percent, from 0.042 to 0.039 per
Earlier, and blind to testing. After the first peak, infections started falling on day seventy two. The wastewater showed the turn on day. day seventy four with the correction and day seventy seven without it. Reported cases showed it only on day eighty three, six to nine days after the wastewater. And wastewater doesn't care about testing policy. In the two weeks after testing was cut on day one hundred fifty, infections grew 2.4 percent a day. Cases showed only 0.5. Wastewater showed 1.7.
Syndromic and pharmacy signals. Syndromic signals react fast too: emergency visits for fever, searches for symptoms. But they drift. Our search index followed symptom onsets with a correlation above 0.96 all year, yet it said the second wave was 2.8 times the first peak. The truth was 2. Pharmacy sales and absenteeism are broad, but not specific. At the peak, only twenty eight percent of our cold medicine sales came from this epidemic. The rest came from other illnesses.
Combining streams. The best use of these streams is together: one hidden epidemic, and many observation equations, each stream with its own delay, scale and noise, weighted by how much it can be trusted. Even the simplest version helps. Weighting the growth rates from cases and wastewater by their reliability, about three quarters cases and one quarter wastewater, gave a smaller error than either stream alone. No stream is the epidemic. Each one is a view of it, and good models combine the views.
Module recap. That closes Module nine. Next, in Module ten: interventions, from lockdowns to vaccines, and how to put them into a model.
3:17Episode 38 · 9.1Surveillance as measurement, and mobility dataCases are infections seen through delays and a changing reporting share; correct serosurveys for test errors; phone data count only the phones they see.
2:41Episode 39 · 9.2Genomics: from sequences to transmissionFifty genomes a week found a new variant around day 31, five hundred around day 10; a constant sampling bias distorts its share, not its growth.
2:48Episode 40 · 9.3Wastewater, syndromic and pharmacy signalsWastewater turned 6 to 9 days before reported cases and ignored a testing cut; combining streams beat any one alone.
Interactive lab
What surveillance sees
Change the reporting share and delay, correct a serosurvey for sensitivity and specificity, and see how noise, rain and sampling change what wastewater shows.
The module's simulated city runs in your browser: the true infections are known, and each panel shows what one data stream would see.
One hidden epidemic, three views
The module's simulated city: a million people, a lockdown on day 62, a relaxation on day 110. The infections (orange) are known; each panel shows what one data stream would see. Everything runs in your browser.
Imperfect tests: false positives dominate when few people have been infected.
Shedding from all recent infections, diluted on rainy days, measured with noise.
Running…
Infections and cases
Orange: new infections; blue: reported cases ÷ the first share.
Challenges
Each one is checked on your current settings, in its own panel.
- Make reported cases fall for at least 10 days while infections rise.
- Serosurvey: with fewer than 1% ever infected, get a positive share more than 3 times the truth.
- Serosurvey: get the corrected 90% range narrower than 1 percentage point (with more than 0.5% infected).
- Wastewater: with noise of 0.5 or more, see the first wave turn at least 2 days before reported cases (and not before the infections).
Running…
True and observed positivity
Black: share ever infected; orange: the expected share testing positive.
Running…
Infections and wastewater
Orange: infections; blue dots: samples (light blue: rainy days); dashed: the day each stream turns.
