What one season of influenza surveillance can and cannot tell us
An SIR model fitted to Canada’s 2022/23 influenza A wave, written as a guided tour
Author
Gabriel Hagen Antunes
Published
November 18, 2026
NoteHow to read this report
This is a modelling study written as a guided tour. You do not need to have fitted a model to data before.
Each section starts with the question it answers and ends with what the answer means.
Boxes marked Concept explain a technical idea the first time it is needed. Try it boxes give a few lines of R you can run in the project folder. Check yourself boxes ask one question; click to reveal the answer.
Every number in the text is read from a table in output/tables/, produced by the code in the project; nothing is typed in by hand.
NoteSummary
The question. Public health agencies watch influenza through weekly counts of laboratory detections. Canada’s 2022/23 season produced the earliest and most intense autumn wave in its surveillance record: 59,554 influenza A detections in the 26 weeks from ISO week 35 of 2022 to week 8 of 2023, peaking at 9,702 in 2022-W48 (Public Health Agency of Canada 2023). This study fits the simplest epidemic model, the SIR, to those counts and asks four things: what the season implies about how transmissible the virus was, how long people were infectious and what fraction of infections was detected; which of those the data can actually tell apart; how early the peak and the season total could have been forecast; and how much the choice between a Poisson and a negative-binomial description of the counts matters.
The approach. Weekly new infections from a deterministic SIR model, times a reporting fraction, plus a background rate, observed with Poisson or negative-binomial noise. Priors from published influenza estimates (a reproduction number centred on 1.28, an infectious period of about three days, one detection per 79 infections), with a far weaker set as the alternative. Maximum likelihood with profile likelihoods, then adaptive Metropolis sampling with four chains, convergence diagnostics, posterior predictive checks, refits week by week with proper scoring rules, and 50 simulated seasons per observation model to check that the intervals mean what they claim.
What it found.
The season’s parameters, under the literature prior and the negative-binomial model: a reproduction number at the start of the season of 1.35 (1.23 to 1.5), a mean infectious period of 3.53 (2.42 to 5.02) days, 3.1 detections per 1,000 infections (2.3 to 4.5), a background of 20 detections a week, and an early doubling time of 7.1 days. The Poisson model gives intervals several times narrower, and they are wrong (see 4).
The data identify the growth rate, not its parts. The likelihood has a ridge along which the reproduction number and the infectious period rise together at a fixed growth rate, and it keeps rising to an “optimum” with a reproduction number of 8.3 and a 71-day infectious period, 43 log-likelihood units above the plausible optimum under the Poisson model. The infectious period is decided by the prior (its posterior is 18% narrower than the prior in variance; the reporting fraction’s is 97%), and the reporting fraction cannot be separated from the share of the population that was susceptible at all.
Forecasts become useful only around the peak. With the negative-binomial model, the 95% interval for the season total was 16,537 to 668,697 detections six weeks in, still 43,176 to 883,344 two weeks before the peak, and 50,643 to 77,526 two weeks after it (observed 59,554). The peak week was forecast to within 2 weeks from ten weeks of data on. The Poisson model’s forecasts were confident and wrong: its 95% intervals covered 0% of the weeks that followed the 12-week fit.
The observation model matters more than the prior for honesty. The Poisson model treats counts of 10,000 as known to within about 100, so it over-fits week-to-week noise: its posterior predictive intervals covered 35% of the observed weeks against 96% for the negative binomial, and a dispersion check rejects it (posterior predictive p-value 0). On simulated seasons, negative-binomial 95% intervals covered the true reproduction number 100% of the time; Poisson intervals fitted to negative-binomial seasons covered it 10% of the time.
These are statements about a deliberately simple model and one season. Section 8 says what they do not cover.
1 The problem: counts that grow, peak and fall
Every week during an influenza season, laboratories across a country report how many specimens tested positive for influenza. Plotted over time, the counts rise, peak and fall over a few months. Behind them sits an epidemic: people who were susceptible, became infected, infected others while they were infectious, and recovered. Three questions follow naturally.
How fast did it spread, and how many infections did each one cause at the start? That is the reproduction number.
How long was a person infectious? That sets the pace at which a given reproduction number turns into a growth rate.
What fraction of infections ended up as a laboratory detection? Most people with influenza are never tested; the counts are a small, unknown share of what happened.
An epidemic model answers these by proposing a mechanism (the SIR model, Section 3) and asking which parameter values make the observed counts likely. The catch, and the reason this study exists, is that several combinations of parameters produce almost the same curve. A season of counts constrains some things tightly and others hardly at all, and the only way to know which is to check.
ImportantWhat this study is, and is not
It is an educational modelling study of what one season of public surveillance counts can support, using a model simple enough that every part can be checked. It is not an analysis of Canada’s epidemic: the model has no age structure, no prior immunity, no seasonality and no delay between infection and detection, and the counts come from a testing system whose volume tripled during the wave. The parameter estimates describe the model’s reading of the counts, not the virus. The numbers that matter are the comparisons: Poisson against negative binomial, literature prior against weak prior, six weeks of data against sixteen.
2 The data
The counts come from WHO FluNet, the public database of the Global Influenza Surveillance and Response System (World Health Organization 2026). Canada reports weekly laboratory detections of influenza A and B to it, with the influenza A detections split, where the laboratory subtyped them, into A(H3) and A(H1N1)pdm09. The pipeline downloads the extract for 2022 and 2023 directly from the FluNet CSV endpoint (the file, its query, download date and MD5 are in data/), and runs offline from the kept copy.
Table 1: The season in numbers (from data_summary.csv). The main window is ISO week 35 of 2022 to week 8 of 2023.
Quantity
Value
Weeks in the main window
26
Influenza A detections, main window
59,554
Peak week (ISO)
2022-W48
Peak weekly count
9,702
Count in the first week of the window
19
Specimens processed, minimum in the main window
12,544
Specimens processed, maximum in the main window
44,884
Positivity at the peak (influenza A detections per specimen)
22.4%
Share of influenza A that was subtyped, main window
30.8%
Share of H3N2 among subtyped influenza A, main window
92.2%
Subtyped share in the first 8 weeks
48.6%
Subtyped share in the 4 peak weeks
30.7%
Mean influenza A detections per week in the 15 weeks before the window
470.4
Mean influenza A detections per week, weeks 9-20 of 2023
123.9
Population N
39,292,355
Figure 1: The data. (a) Weekly influenza A detections in Canada’s non-sentinel laboratories from January 2022 to the end of 2023, with the 26-week main window (dark), the 38-week long window (light) and the six real-time cut weeks. (b) Specimens processed and the share positive for influenza A over the long window. (c) How much of the influenza A was subtyped, and into what.
What to look for in Figure 1. Three things shape the design. First, the 2022/23 wave is a single, sharp hump: 19 detections in the first week of the window, 9,702 at the peak 14 weeks later, and back below 200 nine weeks after that. An SIR model describes one epidemic in one well-mixed population, and this is as close as surveillance data come to that. Second, the testing volume (panel b) rose from 12,544 specimens a week to 44,884 at the peak, so detections are not a fixed fraction of infections week by week; the model’s constant reporting fraction is an average. Third (panel c), the share of influenza A that laboratories subtyped fell from 49% in the first eight weeks to 31% around the peak as they became busier. Of the subtyped specimens, 92% were H3N2, so the wave was one subtype, but a series of H3 counts alone would carry that falling subtyping share as a spurious change in ascertainment. The study therefore fits all influenza A detections.
Two features of the surrounding months matter for interpretation. Canada had an unusual out-of-season wave in spring 2022, visible on the left of panel (a): the 15 weeks before the window averaged 470 detections a week, far above the 19 the window starts with. And after week 8 of 2023 influenza A settled at 124 detections a week for months while influenza B rose (Public Health Agency of Canada 2023). A one-epidemic model with a constant background is not meant for that plateau, which is why the main window stops at week 8 and the 38-week window is a sensitivity analysis (Section 6.1).
3 The model, explained
3.1 Susceptible, infectious, recovered
The SIR model (Kermack and McKendrick 1927; Keeling and Rohani 2008) divides a population of people into susceptible, infectious and recovered. Each infectious person infects susceptible people at a rate proportional to the share of the population still susceptible, and recovers at a constant rate. Two numbers describe it: the reproduction number at the start of the season, , the mean number of infections caused by one infectious person when nearly everyone is susceptible, and the mean infectious period in days. The transmission rate is per day and the recovery rate .
Three consequences of these equations drive everything that follows:
Early growth is exponential at rate per day. A reproduction number of 1.3 with a 3-day infectious period grows at the same rate as 1.6 with 6 days. Early counts measure the growth rate; they cannot tell from .
The epidemic turns over when susceptibles run short. The peak comes when the susceptible share falls to , and the eventual share infected (the final size) solves . For that is 42%; for , 80%.
A long infectious period with a high makes a sharper epidemic than a short one with a low at the same growth rate, because the depletion of susceptibles, rather than recovery, ends it. This is the mechanism behind the ridge in Section 6.2.
The model also needs the number of infectious people at the start of the window, , and the population , which is Canada’s 39,292,355 on 1 October 2022 (Statistics Canada 2022).
3.2 From infections to counts
The model’s state is unobserved. What the laboratories count is a sample of the new infections, so the study follows King et al. (2015) in modelling incidence, the number of new infections in each week, rather than the number infectious at an instant. Week of the window covers days to ; the model’s new infections in that week are , and the expected number of detections is
with the reporting fraction (detections per infection) and a background of detections a week not generated by the epidemic (sporadic cases, false positives, late reports). The observed count is then a random draw around :
Poisson: , variance equal to the mean. The variance of a count of 10,000 is 10,000, so its standard deviation is 100.
Negative binomial: , variance . With a count of 10,000 has a standard deviation of about 3,200. The extra variance stands in for everything the model leaves out: changing test volumes, reporting delays, several provinces peaking at different times.
TipConcept: the likelihood
Given parameter values , the model says how probable each observed count was. The product of those probabilities over the 26 weeks is the likelihood of ; its logarithm, the log-likelihood, is what the code computes. A parameter set whose log-likelihood is 2 units lower than another made the data about times less probable; 10 units lower, 22,000 times. The maximum likelihood estimate (MLE) is the that makes the data most probable. Everything about “what the data say” is a statement about the shape of the log-likelihood over .
TipConcept: overdispersion
Poisson counts have a variance equal to their mean. Real surveillance counts almost always vary more than that, because the mean itself moves from week to week for reasons outside the model. Counts with more variance than a Poisson are overdispersed, and the negative binomial is the standard way to allow it. Choosing the Poisson when the data are overdispersed does not bias the fitted curve much, but it makes every uncertainty statement too small, because the model believes each point pins the curve down to within . Section 6.4 measures that effect.
3.3 Priors
A Bayesian fit multiplies the likelihood by a prior: what was believed about each parameter before seeing this season. The main prior set comes from published influenza estimates (Table 2); a weak set, at least four times wider on every parameter, shows what the data alone support. Every value and its source is in parameters.R.
Table 2: The two prior sets. Log-normal priors are given by their median and 95% range; the background has an exponential prior and the negative-binomial size k a half-normal prior on 1/sqrt(k).
TipConcept: prior, posterior and what “the data say”
The posterior is proportional to prior times likelihood: the prior re-weighted by how well each parameter value explains the data. Where the likelihood is flat, the posterior is the prior; where the likelihood is sharply peaked, the prior hardly matters. Comparing each parameter’s posterior with its prior (Figure 6) therefore shows which parameters the data informed. Two summaries are used here: the shrinkage, one minus the ratio of posterior to prior variance on the log scale (0 means the data taught nothing, 1 means the prior was irrelevant), and the overlap of the two densities.
TipConcept: identifiability
A parameter is identifiable from a data set if different values of it would, in principle, produce different data. Two parameters that only ever appear as a product are not: doubling one and halving the other changes nothing. In this model that is exactly the situation of the reporting fraction and the share of the population susceptible at the start. If only a fraction of the population is susceptible, the detection curve is identical to the one from a fully susceptible population with reporting fraction and initial infectives, at the same and (an exact result, checked by a unit test). So the study fixes , interprets as “detections per infection if everyone was susceptible”, and reports what would be for 80% and 60% susceptible. Practical non-identifiability is weaker: the data do distinguish the values in principle, but so feebly that the likelihood is nearly flat over a wide range. The profile likelihoods in Section 6.2 are the tool for seeing it (Raue et al. 2009).
4 Did we build it right?
TipConcept: verification is not validation
Verification asks whether the code solves the stated model correctly. Validation asks whether the model describes reality. This section is only verification. Nothing in it says the SIR is a good model of influenza; it says that the differential equations, the likelihoods, the priors, the optimiser, the sampler and the diagnostics do what they claim.
Unit tests.tests.R holds 23 tests (make test). The ODE keeps the population constant, decays exponentially when transmission is switched off, and reaches the final size predicted by the Kermack–McKendrick relation to within one part in a million. The Poisson log-likelihood equals a hand-computed sum of dpois terms; the negative binomial tends to the Poisson as grows and has the right variance. Every prior density integrates to one on the log scale with the correct Jacobian, and the literature priors reproduce their published anchors. The rescaling leaves the detection means unchanged. The sampler recovers a Gamma–Poisson posterior, whose closed form is known, within Monte Carlo error, and learns the covariance of a correlated Gaussian. R-hat is 1 and the effective sample size equals the draw count on independent draws, the ESS follows the AR(1) formula on autocorrelated chains, and a shifted chain is flagged. The CRPS of a point forecast is the absolute error and the sample CRPS matches the normal closed form. The FluNet parser rejects gaps and missing counts. The MLE recovers known parameters from a simulated season, and every chain is reproducible from its seed.
Checks at scale (stage checks, Figure 2 and Table 3). The sampler used for every fit was run on two problems with known answers; the final-size relation was checked at four reproduction numbers; the early growth rate of the solved curve was compared with at 9 parameter pairs, of which 8 agree to a relative (the exception, = 2 with = 2 days, is off by 5^{-4}); the diagnostics were run on chains with known autocorrelation; and 1,000 seasons were drawn from each prior set to see what they considered plausible before any data.
Table 3: Checks of the sampler and the diagnostics against known answers (checks_sampler.csv, checks_diagnostics.csv).
Check
Expected
Estimate
Pass
Gamma-Poisson posterior: mean
4.195
4.193
TRUE
Gamma-Poisson posterior: sd
0.4524
0.4509
TRUE
Gamma-Poisson posterior: q025
3.356
3.349
TRUE
Gamma-Poisson posterior: q975
5.127
5.123
TRUE
Gamma-Poisson posterior: R-hat
1
1.001
TRUE
Gamma-Poisson posterior: bulk ESS
4,190
TRUE
Gamma-Poisson posterior: acceptance
0.44
0.5064
TRUE
3-D Gaussian, correlations 0.9, 0.3 and 0.2: max |adapted cov - truth| / sd_i sd_j
0
0.07111
TRUE
3-D Gaussian, correlations 0.9, 0.3 and 0.2: max |posterior sd / truth - 1|
0
0.01262
TRUE
3-D Gaussian, correlations 0.9, 0.3 and 0.2: max R-hat
1
1.005
TRUE
3-D Gaussian, correlations 0.9, 0.3 and 0.2: min bulk ESS
1,700
TRUE
3-D Gaussian, correlations 0.9, 0.3 and 0.2: acceptance
0.234
0.2429
TRUE
Diagnostics, independent N(0,1): R-hat
1
1
TRUE
Diagnostics, independent N(0,1): bulk ESS
8000
7,717
TRUE
Diagnostics, AR(1), rho 0.9: R-hat
1
1.014
TRUE
Diagnostics, AR(1), rho 0.9: bulk ESS
421.052631578947
384.1
TRUE
Diagnostics, one chain shifted by 3 sd: R-hat
>1.3
1.478
TRUE
Figure 2: Checks. (a) The eventual share infected from the ODE solved to 3,000 days against the final-size relation. (b) Draws from the adaptive Metropolis sampler on a Gamma–Poisson posterior against its exact density. (c, d) 200 of 1,000 seasons simulated from each prior set, before any data, with the observed counts.
What to look for in Figure 2. Panels (c) and (d) are prior predictive checks. The literature prior produces seasons whose peak lands within three weeks of the observed one 40% of the time and whose peak height is within a factor of three 35% of the time: it is informative about shape, vague about size, as intended. The weak prior spans peaks from 85 to 3,874,116 detections a week.
The maximum likelihood estimate was checked three ways (stage mle). A second optimiser (Nelder–Mead) started at the BFGS optimum moved it by less than 0.01 log-likelihood units for both models. A grid of 16,807 points over the central 95% of the literature prior found no point better than the optimum restricted to that region (best grid value -1,592.8 against -320.3 for the Poisson model). And 20 restarts from weak-prior draws ended in 3 distinct basins, which is the subject of Section 6.2.
5 How the fits were run
TipConcept: Markov chain Monte Carlo in three sentences
The posterior is a six-dimensional surface that cannot be written down, so it is explored by a random walk: from the current parameter values, propose a nearby point, compute the posterior density there, and move with a probability that depends on the ratio of the two densities (the Metropolis rule). Run long enough, the walk visits parameter values in proportion to their posterior probability, so its path is a sample from the posterior. The art is in the proposals: the sampler here learns the shape of the posterior as it goes (the covariance of its own path, after Haario et al. (2001)) and tunes its step size to accept about a quarter of proposals (Roberts et al. 1997; Roberts and Rosenthal 2009), during a warm-up phase that is then discarded.
Each fit ran 4 chains of 10,000 warm-up and 10,000 sampling iterations. Chains start from different places: each takes a draw from the prior to the nearest posterior mode by optimisation and starts from a point drawn around that mode with twice the posterior’s local spread. Chains move in rather than , because the posterior ridge of constant growth rate is straight in those coordinates. The two observation models and two prior sets give four fits on the main window; two more fit the literature prior on the 38-week window.
TipConcept: has the sampler converged, and how precise is the answer?
Two diagnostics from Vehtari et al. (2021) are computed in base R for every parameter of every fit. R-hat compares the spread between chains with the spread within them; chains that have found the same posterior give values close to 1, and the study requires at most 1.01. The effective sample size (ESS) is the number of independent draws the correlated chain is worth; the study requires at least 400 for the bulk and the tails of each posterior. From the ESS follows the Monte Carlo standard error (MCSE) of a posterior mean, the precision of the estimate given finite sampling. It is a different thing from the posterior standard deviation, which is uncertainty about the parameter and does not shrink with longer chains.
Table 4: Convergence of the six full-season fits: the worst R-hat and the smallest effective sample size over parameters, acceptance rate and run time (fit_diagnostics.csv).
Fit
Model
Prior
Window
Max R-hat
Min bulk ESS
Min tail ESS
Acceptance
Seconds
Pass
Poisson_lit_main
Poisson
literature
main
1
1,984
3,026
0.24
47
TRUE
NB_lit_main
NB
literature
main
1.01
1,268
947
0.24
45
TRUE
Poisson_weak_main
Poisson
weak
main
1
2,109
2,699
0.23
50
TRUE
NB_weak_main
NB
weak
main
1
1,214
1,311
0.23
47
TRUE
Poisson_lit_long
Poisson
literature
long
1
2,212
2,534
0.24
62
TRUE
NB_lit_long
NB
literature
long
1
1,804
2,650
0.23
63
TRUE
All six fits pass both criteria. Figure 3 shows the chains of the reference fit.
Figure 3: Trace plots of the four chains for the negative-binomial model under the literature prior. The grey band is the warm-up, during which the proposal adapts; only the draws after it are used. Each panel gives the parameter’s R-hat and effective sample sizes.
TipConcept: proper scoring rules
A forecast is a probability distribution for a future count, not a number. To compare forecasts one needs a score that cannot be gamed by hedging or by false confidence. The log score is the log of the probability the forecast gave to the count that occurred; the continuous ranked probability score (CRPS) is the average distance between the forecast distribution and the outcome, in the units of the count, and equals the absolute error for a point forecast (Gneiting and Raftery 2007; Krüger et al. 2021). Both are “proper”: the expected score is best when the forecast is the truth. Alongside them the study reports coverage, the share of outcomes that fell inside the 50% and 95% forecast intervals, which should be about 50% and 95% if the forecasts are honest.
TipConcept: the pilot rule
Chain lengths and the number of simulated seasons were fixed by a rule written down before the main runs: short pilot chains measure the cost per iteration and the effective draws per iteration; the main fits keep 10,000 sampling iterations per chain unless the projected ESS falls short of 400, and the simulation study uses 100 seasons per generating model if the whole pipeline projects to at most 30 minutes on four cores, otherwise 50, otherwise 25. The pilot measured 2.1 ms per iteration with a load average of 7.35 and 8 other R processes on the machine (another pipeline was running), projecting 56 minutes at 100 seasons; parameters.R records why 50 was chosen.
6 Results
6.1 The full-season fit (Q1)
What to look for in Figure 4. Panels (a) and (b) show the same data and the same SIR model under the two observation models. Compare the widths of the shaded predictive bands with how the points scatter around the fitted curve. Panel (c) adds the 38-week window on a log scale: the question is whether extending the window changes the fitted epidemic or only the background.
Figure 4: The full-season fits under the literature prior. (a) Poisson and (b) negative-binomial observation models: the posterior median of the expected count with 50% and 95% posterior predictive intervals for the counts. (c) The negative-binomial fit on the main window (green) and on the 38-week window (grey), log scale.
Table 5: Posterior medians and 95% intervals under the literature prior, main window, with the prior median, the MLE restricted to infectious periods of at most 10 days, and the Monte Carlo standard error of the posterior mean (posterior_summary.csv).
Quantity
Model
Median
95% interval
Prior median
MLE (D <= 10 d)
MCSE
reproduction number at the season start
Poisson
1.38
(1.32 to 1.44)
1.28
1.41
0.00068
reproduction number at the season start
negative binomial
1.35
(1.23 to 1.5)
1.28
2.09
0.0017
mean infectious period (days)
Poisson
3.59
(3.08 to 4.15)
3
3.87
0.0061
mean infectious period (days)
negative binomial
3.53
(2.42 to 5.02)
3
10
0.015
detections per infection
Poisson
0.00301
(0.00274 to 0.00334)
0.0127
0.00287
0.0000034
detections per infection
negative binomial
0.00313
(0.00234 to 0.00446)
0.0127
0.00177
0.000013
background detections per week
Poisson
38.6
(32.4 to 44.9)
34.7
37.5
0.067
background detections per week
negative binomial
19.8
(4.33 to 44.9)
34.7
20.1
0.26
infectious people at the start
Poisson
234
( 198 to 275)
1,000
251
0.44
infectious people at the start
negative binomial
390
( 141 to 881)
1,000
641
4.9
negative-binomial size
negative binomial
9.18
(4.35 to 17.8)
2.2
22.1
0.089
early growth rate (per day)
Poisson
0.106
(0.105 to 0.107)
0.107
early growth rate (per day)
negative binomial
0.0975
(0.0878 to 0.109)
0.109
doubling time (days)
Poisson
6.53
(6.45 to 6.62)
6.51
doubling time (days)
negative binomial
7.11
(6.37 to 7.9)
6.35
eventual attack rate (final-size relation)
Poisson
0.495
(0.449 to 0.544)
0.52
eventual attack rate (final-size relation)
negative binomial
0.467
(0.35 to 0.585)
0.82
peak week of new infections (index)
Poisson
14
( 14 to 14)
14
peak week of new infections (index)
negative binomial
14
( 14 to 15)
14
expected detections in the window
Poisson
59,600
(59,100 to 60,000)
59,600
expected detections in the window
negative binomial
57,500
(47,800 to 71,400)
57,500
What it means. Both observation models put the reproduction number near 1.4 and the infectious period near 3.5 days, with an early doubling time of about 7.1 days, and both reproduce the season total (expected detections 57,504 against 59,554 observed) and the peak week. The difference is in the uncertainty. The Poisson model’s 95% interval for is (1.32 to 1.44), the negative binomial’s (1.23 to 1.5); for the reporting fraction the ratio of interval widths is about 3.5. The Poisson predictive band in panel (a) is a thin line that most of the points miss; the negative binomial’s (panel b) contains 96% of them. Which one to believe is settled in Section 6.4: the Poisson model’s confidence is an artefact of assuming that a count of 10,000 is known to within 100.
The implied epidemic is large: with everyone susceptible, a reproduction number of 1.3 infects 47% (35% to 58%) of the population by the time it burns out, and the reporting fraction of 3.1 per 1,000 infections is what scales that to 59,554 detections. Section 7 returns to whether that is plausible, and Section 6.2 to why the two cannot be separated.
The 38-week window (panel c) leaves the epidemic’s parameters almost where they were under the negative-binomial model ( 1.35 (1.23 to 1.5), 3.02 ( 2.1 to 4.19) days) and raises the background from 20 to 98 detections a week to absorb the spring plateau. Under the Poisson model the background rises to 93 a week and the reproduction number shifts to 1.29 (1.25 to 1.35).
NoteCheck yourself: the Poisson band in Figure 4 (a) hugs the fitted curve and most points fall outside it. What does that tell you?
That the Poisson assumption is wrong for these counts, not that the fit is bad. The band is the model’s prediction of how far counts should scatter around the curve: with Poisson variance, a week expected to have 9,000 detections should land within about 200 of it. The observed weeks scatter several times more widely, which is what overdispersion looks like. The dispersion check in Section 6.4 puts a number on it: the observed dispersion statistic is 452 where Poisson replicates average 26.
6.2 What the data identify (Q2)
What to look for in Figure 5. Each panel is one parameter. The solid line is the profile likelihood: at each value of the parameter on the horizontal axis, the other parameters are re-optimised and the best log-likelihood is plotted relative to the overall maximum. The dashed line is the slice, the same curve with the other parameters held fixed at the optimum, which is what one gets by varying one parameter at a time. A parameter the data pin down gives a narrow profile; a flat profile means the data do not care. The horizontal dotted line is the 95% cut-off: values whose profile lies above it are within the 95% profile-likelihood interval (Venzon and Moolgavkar 1988). The two vertical lines mark the unrestricted optimum and the optimum restricted to infectious periods of at most 10 days.
Figure 5: Profile likelihoods (solid) and one-at-a-time slices (dashed) for every parameter, Poisson model above, negative binomial below. The vertical axis is cut at −30 units; the shaded band is the 95% profile-likelihood interval around the unrestricted optimum. Note the horizontal log scales.
Table 6: Maximum likelihood estimates: the optimum restricted to infectious periods of at most 10 days and the unrestricted optimum, with 95% profile-likelihood intervals around the latter (mle_estimates.csv, profile_ci.csv).
Model
Parameter
Restricted MLE
Unrestricted MLE
95% profile interval
Poisson
Re
1.41
8.3
(7.54 to 9.22)
Poisson
D
3.87
71.2
(63.5 to 80.8)
Poisson
iota
251
2,010
(1,810 to 2,220)
Poisson
delta
0.00287
0.00151
(0.0015 to 0.00152)
Poisson
eps
37.5
19.1
(13.9 to 24.8)
negative binomial
Re
2.09
5.86
(4.47 to 7.53)
negative binomial
D
10
45.7
(31.6 to 63.7)
negative binomial
iota
641
1,420
( 777 to 2,580)
negative binomial
delta
0.00177
0.0015
(0.00135 to 0.00167)
negative binomial
eps
20.1
18.5
(10.1 to 28.1)
negative binomial
k
22.1
38.7
(18.7 to 76.5)
What it means: the ridge. Read the and panels together. Under both observation models the profile rises from the plausible region (a reproduction number near 1.4 with a 3- to 4-day infectious period) to an unrestricted optimum at = 8.3 with = 71 days (Poisson) and = 5.9 with = 46 days (negative binomial). The Poisson log-likelihood gains 43 units on the way; the negative binomial 5.8. Along that ridge the growth rate stays at 0.1 per day (restricted optimum: 0.11): the early weeks fix it, and the data then cannot tell a fast virus that most people escape from a slow one that infects 100.0% of the population. The slices hide all this: held at the optimum, every other parameter looks sharply determined. That is why one-at-a-time slices, the device used in the coursework this project grew from, say nothing about identifiability.
The restarts tell the same story from a different angle. Of 20 Poisson fits started from weak-prior draws, 5 ended in the plausible basin, 1 on the ridge and 14 in a third place where the epidemic is explained away as background (log-likelihood -57,322); for the negative binomial the counts were 0, 5 and 13, with 2 of the 20 starts returning no fit. A restart is counted at an optimum when it ended within one log-likelihood unit of it. An analyst who started an optimiser once, from a sensible place, would report the plausible optimum and never see the ridge.
What the prior does.Figure 6 overlays each parameter’s prior with the two posteriors, under the literature prior (top) and the weak prior (bottom), and Table 7 gives the shrinkage.
Figure 6: Prior (shaded) against posterior for every parameter, under the literature prior (top row) and the weak prior (bottom row), for both observation models, on the log scale.
Table 7: How far each posterior moved from its prior, negative-binomial model: posterior and prior medians, the ratio of posterior to prior standard deviation on the log scale, the shrinkage (1 minus the variance ratio) and the overlap of the two densities (prior_posterior_overlap.csv).
Prior
Parameter
Prior median
Posterior median
SD ratio
Shrinkage
Overlap
literature
Re
1.28
1.35
0.51
74%
0.62
literature
D
3
3.53
0.9
18%
0.67
literature
iota
1,000
390
0.23
95%
0.36
literature
delta
0.0127
0.00313
0.16
97%
0.14
literature
eps
34.7
19.8
0.47
78%
0.52
literature
k
2.2
9.18
0.16
97%
0.23
weak
Re
1.5
1.9
0.38
86%
0.49
weak
D
3
8.42
0.59
65%
0.2
weak
iota
1,000
598
0.13
98%
0.26
weak
delta
0.01
0.00191
0.074
99%
0.12
weak
eps
139
20.7
0.29
91%
0.17
weak
k
2.2
15.4
0.17
97%
0.2
Under the literature prior the infectious period’s posterior is barely narrower than its prior (shrinkage 18%, overlap 0.67): the data added almost nothing about , and the credible interval for in Table 5 is the prior’s. The reproduction number’s posterior is narrower than its prior by 74% in variance, but that narrowing is conditional on the prior for : given a 3-day infectious period, the growth rate fixes . The reporting fraction and the initial infectives are data-dominated (shrinkage 97% and 95%), the background largely so (78%). Under the weak prior the negative-binomial posterior slides up the ridge to = 1.9 (1.46 to 2.63) and = 8.42 (4.56 to 14.5) days, still well short of the unrestricted optimum because the weak prior on (95% range 1.1 to 8 days) still counts against 45 days. The Poisson posterior under the weak prior stays in the plausible basin ( = 1.4 (1.33 to 1.46), = 3.73 (3.14 to 4.32) days), because the Poisson likelihood falls off so steeply away from each local optimum that the chains cannot cross between basins.
Correlations.Figure 7 shows the posterior draws of the reference fit two parameters at a time. The correlation between and is 0.96 and between and -0.83: the ridge, seen from inside the prior’s range. The reporting fraction and the initial infectives are correlated at -0.5, since the first weeks’ counts fix their product.
Figure 7: Posterior draws of the negative-binomial fit under the literature prior, two parameters at a time on the log scale, with the correlations in the upper panels.
The susceptible fraction.Table 8 re-expresses the fit for a population in which only 80% or 60% were susceptible when the season began. Nothing else changes: the same curve, the same likelihood. What changes is the meaning of the numbers: the reporting fraction rises to 5.2 per 1,000 infections and the basic reproduction number, the one that would apply in a fully susceptible population, to 2.2.
Table 8: The negative-binomial fit under the literature prior re-expressed for three initially susceptible fractions: an exact rescaling, not a refit (s0_rescaling.csv).
Susceptible at the start
Quantity
Median
95% interval
100%
detections per infection
0.00313
(0.00234 to 0.00446)
100%
infectious people at the start
390
( 141 to 881)
100%
basic reproduction number (Re / s0)
1.35
(1.23 to 1.5)
80%
detections per infection
0.00391
(0.00293 to 0.00557)
80%
infectious people at the start
312
( 113 to 705)
80%
basic reproduction number (Re / s0)
1.68
(1.53 to 1.88)
60%
detections per infection
0.00522
(0.0039 to 0.00743)
60%
infectious people at the start
234
(84.6 to 528)
60%
basic reproduction number (Re / s0)
2.24
(2.04 to 2.51)
NoteCheck yourself: why would a likelihood prefer a 71-day infectious period for influenza?
Because nothing in 26 weekly counts says how long anyone was infectious. The counts fix the growth rate, the peak timing, the peak height and the decline, and a model with a long infectious period and a high reproduction number can match all four: the epidemic is ended by running out of susceptible people, which produces a sharper peak and a cleaner decline than recovery at a modest does. Under the Poisson model the peak weeks carry enormous weight (a count of 9,702 is supposedly known to within 100), so an improvement of a few percent in the shape near the peak is worth tens of log-likelihood units. The information about the infectious period has to come from elsewhere, which is what the prior from household and challenge studies supplies. The lesson generalises: when a model has more mechanisms than the data have features, the fitted values of the extra mechanisms are decided by whatever the analyst assumed, and the honest report says so.
6.3 How early could the season have been forecast? (Q3)
The model was refitted using only the first 6, 8, 10, 12, 14 and 16 weeks of the window (ISO weeks 40 to 50 of 2022; the peak was 2022-W48, the 14th week), with the literature prior and both observation models, and each fit’s posterior predictive distribution for the remaining weeks was scored against what happened. The full-season fit, scored on the same weeks, is the retrospective reference: the best this model could do knowing the whole season.
What to look for in Figure 8. Filled points were available to the fit; open points came later. The green fan is the negative-binomial forecast (median, 50% and 95%), the orange lines the Poisson median and 95% limits. Ask at each cut: does the fan contain what happened, and how wide must it be to do so?
Figure 8: Real-time refits. Each panel uses only the filled points; the bands are posterior predictive intervals for every week of the window. Bands are cut at 1.8 times the observed peak.
Table 9: Forecasts of the season’s peak week, peak count and total detections from each cut, negative-binomial model, literature prior: posterior predictive median and 95% interval, with the observed value (realtime_targets.csv). The last row is the full-season fit.
Data used
Peak week
Peak count
Season total
Observed inside 95%
6 weeks
17 (12 to 24)
19,204 (2,357 to 126,906)
115,425 (16,537 to 668,697)
yes / yes / yes
8 weeks
17 (13 to 22)
16,824 (2,573 to 99,525)
120,595 (19,665 to 655,104)
yes / yes / yes
10 weeks
16 (13 to 20)
26,329 (5,700 to 135,872)
150,747 (32,697 to 774,409)
yes / yes / yes
12 weeks
16 (13 to 19)
28,864 (7,729 to 150,181)
164,062 (43,176 to 883,344)
yes / yes / yes
14 weeks
15 (13 to 18)
12,510 (7,948 to 36,647)
72,284 (47,775 to 220,072)
yes / yes / yes
16 weeks
14 (13 to 16)
10,519 (8,051 to 15,109)
61,089 (50,643 to 77,526)
yes / yes / yes
all 26 weeks
14 (12 to 16)
10,672 (6,776 to 18,517)
56,890 (42,376 to 78,111)
yes / yes / yes
The observed values were a peak in week 14 of 9,702 detections and a total of 59,554.
Figure 9: Scores of the real-time forecasts by the number of weeks used. (a) Mean log score at horizons of 1 to 4 weeks (higher is better; the axis is cut at −40 and off-scale Poisson values are drawn at the edge as triangles). (b) Mean CRPS at the same horizons, log scale. (c) The forecast season total with 95% intervals against the observed total, log scale. (d) The forecast peak week.
Table 10: Scores over all the weeks that followed each cut: mean log score and CRPS, the coverage of the 95% forecast intervals, and the same scores for the full-season fit on the same weeks (realtime_scores.csv).
Weeks used
Model
Log score
CRPS
95% coverage
Reference log score
Reference CRPS
6
negative binomial
-8.6
2,263
100%
-7.4
310
6
Poisson
-9.0
3,198
90%
-12.4
113
8
negative binomial
-9.3
3,307
94%
-7.5
338
8
Poisson
-31.1
4,172
61%
-12.3
117
10
negative binomial
-8.7
3,725
100%
-7.5
359
10
Poisson
-22.9
10,646
25%
-12.4
116
12
negative binomial
-8.9
5,073
100%
-7.4
330
12
Poisson
-286.3
1,479
0%
-12.7
108
14
negative binomial
-7.4
694
100%
-7.1
242
14
Poisson
-13.7
232
33%
-13.3
93
16
negative binomial
-6.9
127
90%
-6.8
151
16
Poisson
-12.5
115
30%
-14.0
75
What it means. Early in the season the honest forecast is very wide. After six weeks, when counts had reached 134 a week and the fitted doubling time was 8.6 days, the negative-binomial model put the season total anywhere between 16,537 and 668,697 detections and the peak between weeks 12 and 24: the growth rate was known, but the growth rate says nothing about when the epidemic will turn, because that depends on the final size, which depends on and the susceptible fraction, neither of which the early counts fix. The intervals shrink slowly until the peak is in the data: two weeks after it (16 weeks) the total is known to within 23% either way. The peak week itself was forecast to within two weeks from 10 weeks of data on, and the forecast intervals of the negative-binomial model contained the observed peak week at every cut.
The Poisson model is the cautionary tale. Its intervals are narrow at every cut, and they are wrong at most of them: from the 12-week fit its 95% intervals covered 0% of the following weeks and its log score was -286, against -8.9 for the negative binomial on the same weeks. A proper score punishes false confidence without mercy: a forecast that gives the outcome a probability of scores −230. Compare the reference scores: knowing the whole season, the negative-binomial model scores -7.4 per week on those same weeks, so the real-time forecasts at 12 weeks were already close to the best this model can do; the remaining gap is the model, not the lack of data.
NoteCheck yourself: at 12 weeks the Poisson forecast said the peak had already passed. Why was it so confident and so wrong?
Because the Poisson likelihood is sharp. Twelve counts, the last of them 6,147, pin down a Poisson-model curve to a tiny region of parameter space, since the model believes each count to within its square root. The small misfit of the SIR shape to the real counts then pushes that region to parameter values whose curve happens to turn over early, and the forecast interval, inheriting the tiny parameter uncertainty, excludes what happened. The negative-binomial model admits that the counts scatter by far more than their square root, its parameter posterior is correspondingly wider, and its forecast fan still contains the two weeks of rise that followed. Overdispersion is not a nuisance to be averaged away; it is the model’s only acknowledgement that it is not the truth.
6.4 Does the observation model matter, and are the intervals honest? (Q4)
Two checks. The first is a posterior predictive check on the real data: simulate counts from the fitted model and compare their dispersion with the observed counts’. The second is a simulation study: generate 50 seasons from each fitted model at its posterior medians, refit each with the matching and the mismatched observation model, and count how often the 95% posterior intervals contain the values that generated the data.
Table 11: Posterior predictive checks of the full-season fits: the dispersion statistic (the sum over weeks of squared residuals divided by the expected count) for the observed counts and for counts replicated from the fit, the posterior predictive p-value, and the share of observed weeks inside the 50% and 95% predictive intervals (ppc_dispersion.csv).
Fit
Model
Prior
Window
Dispersion, observed
Dispersion, replicated
p-value
50% coverage
95% coverage
Poisson_lit_main
Poisson
literature
main
452
26
0
12%
35%
NB_lit_main
negative binomial
literature
main
2,238
6,810
0.91
65%
96%
Poisson_weak_main
Poisson
weak
main
451
26
0
12%
31%
NB_weak_main
negative binomial
weak
main
1,449
4,166
0.9
58%
100%
Poisson_lit_long
Poisson
literature
long
704
38
0
11%
29%
NB_lit_long
negative binomial
literature
long
2,853
11,685
0.97
71%
92%
What it means. For the Poisson fits the observed dispersion is 18 times what the model generates, and no replicate reached it (p-value 0): the Poisson model is rejected by its own predictions. The negative-binomial fits produce replicates at least as dispersed as the data (p-value 0.91) and their 95% intervals cover 96% of the weeks, as they should.
Table 12: Simulation study: coverage of the 95% posterior intervals (with Wilson 95% confidence intervals over the simulated seasons), the mean bias of the posterior median as log(median / truth), and the share of fits flagged for a split R-hat above 1.05 (simstudy_coverage.csv, simstudy_bias.csv).
Figure 10: Simulation study. (a) Coverage of the 95% posterior intervals for each parameter in each setting, with Wilson confidence intervals; the dotted line is the nominal 95%. (b) Mean bias of the posterior median on the log scale with two standard errors.
What it means. When the fitted observation model matches the generating one, the intervals do what they claim: on negative-binomial seasons the negative-binomial 95% intervals contained the true in 100% of seasons (93% to 100%) and the true reporting fraction in 96%; on Poisson seasons the Poisson intervals contained in 94%. That is the verification half: the sampler, the priors and the code produce calibrated intervals when the model is right (Cook et al. 2006; Talts et al. 2018). The mismatch half is the result. Fitting the Poisson model to negative-binomial seasons, which is the realistic case, the 95% intervals for covered the truth in 10% of seasons and for the reporting fraction in 8%. Fitting the negative binomial to Poisson seasons costs only width: coverage 96% for , with intervals wider than needed. The early-window fits (10 weeks, four before the peak) keep their coverage for every parameter (100% for under the negative binomial), but look at how: the 95% interval for the reporting fraction is 34-fold wide against 1.9-fold with the full season, and its posterior median sits 2.6 times above the truth, pulled toward the prior median. Four weeks before the peak the amplitude of the epidemic is not yet in the data, so the reporting fraction and the initial infectives are the prior’s; this is the quantitative version of Section 6.3. With the full season the biases are small except where the prior dominates: -0.15 on the log scale for under the matching model, that is, the posterior median is pulled toward the prior median by about 14% when the truth sits where this fit put it, and -0.04 for .
NoteCheck yourself: if the negative-binomial intervals cover 95% of the time in the simulations, why not trust them for the real season?
Because the simulations were generated by the model. They show that, if the world were an SIR epidemic observed with negative-binomial noise, the code would report honest intervals. The real counts come from a country of provinces peaking at different times, a testing system whose volume tripled, and a population with prior immunity, none of which the model has. The posterior predictive check shows the negative binomial’s extra variance is enough to absorb the week-to-week consequences of all that; it cannot show that the parameters mean what their names say. Coverage in simulation is a check on the machinery, not on the model.
7 What the published studies found, and what this adds
Table 13: The study’s estimates against published values (literature_comparison.csv). ‘Consistent’ means the published value lies inside the study’s 95% interval.
Quantity
Fit
This study, median (95%)
Published
Source
Consistent
reproduction number at the season start
NB (literature prior)
1.35 (1.23 to 1.5)
1.28 (1.19 to 1.37)
Biggerstaff et al. 2014
yes
reproduction number at the season start
NB (weak prior)
1.9 (1.46 to 2.63)
1.28 (1.19 to 1.37)
Biggerstaff et al. 2014
no
reproduction number at the season start
Poisson (literature prior)
1.38 (1.32 to 1.44)
1.28 (1.19 to 1.37)
Biggerstaff et al. 2014
no
reproduction number at the season start
NB (literature prior)
1.35 (1.23 to 1.5)
1.46 ( 1.3 to 1.7)
Biggerstaff et al. 2014
yes
mean infectious period (days)
NB (literature prior)
3.53 (2.42 to 5.02)
2.2
Vink et al. 2014
no
mean infectious period (days)
NB (literature prior)
3.53 (2.42 to 5.02)
3.6 ( 2.9 to 4.3)
Cowling et al. 2009
yes
mean infectious period (days)
NB (literature prior)
3.53 (2.42 to 5.02)
4.8 ( 4.3 to 5.3)
Carrat et al. 2008
yes
mean infectious period (days)
NB (weak prior)
8.42 (4.56 to 14.5)
3.6 ( 2.9 to 4.3)
Cowling et al. 2009
no
eventual attack rate (final-size relation)
NB (literature prior)
0.467 (0.35 to 0.585)
0.107 (0.045 to 0.232)
Somes et al. 2018
no
eventual attack rate (final-size relation)
NB (literature prior)
0.467 (0.35 to 0.585)
0.225 (0.09 to 0.46)
Somes et al. 2018
no
detections per infection
NB (literature prior)
0.00313 (0.00234 to 0.00446)
0.0127 (0.00676 to 0.0213)
Reed et al. 2009
no
detections per infection
NB (weak prior)
0.00191 (0.00153 to 0.0027)
0.0127 (0.00676 to 0.0213)
Reed et al. 2009
no
peak week of new infections (index)
NB (literature prior)
14 ( 14 to 15)
14
FluNet (this window)
yes
weeks with incidence above 10% of the peak
NB (literature prior)
12 ( 10 to 13)
10
CCDR 2023
yes
expected detections in the window
NB (literature prior)
57,500 (47,800 to 71,400)
59,600
FluNet (this window)
yes
expected detections in the window
Poisson (literature prior)
59,600 (59,100 to 60,000)
59,600
FluNet (this window)
yes
The reproduction number under the literature prior, 1.35 (1.23 to 1.5), sits inside the range of published seasonal estimates (median 1.28, quartiles 1.19 to 1.37 (Biggerstaff et al. 2014)) and below the 2009 pandemic’s 1.46; this says little, since the prior was built from that review, and the honest comparison is the weak-prior value, 1.9 (1.46 to 2.63), which lies above the review’s upper quartile of 1.37 because the data pull up the ridge. The infectious period under the literature prior reproduces its prior. The early doubling time of 7.1 days and the peak in the 14th week match the national report’s description of an epidemic that began in week 43 and lasted about ten weeks (Public Health Agency of Canada 2023).
The clearest tension is the attack rate. With everyone susceptible, the fit implies that 47% of Canadians were infected by the end of the season. Meta-analyses of unvaccinated placebo arms put the annual infection attack rate of seasonal influenza at 10.7% in adults and 22.5% in children (Somes et al. 2018). The 2022/23 season was exceptional, after two winters without influenza, but a difference of this size is more plausibly the assumption: if 60% were susceptible, the same curve corresponds to a basic reproduction number of 2.2, a 28% attack rate (the same share of a smaller susceptible pool) and 5.2 detections per 1,000 infections (Table 8). The reporting fraction of 3.1 per 1,000 infections is 0.25 times the 12.7 per 1,000 that Reed et al. (2009) estimated for laboratory-confirmed case reports in the 2009 pandemic; a lower value for routine laboratory surveillance of a seasonal virus is expected, and the posterior is 97% data-driven, so the data did move it there.
What this study adds to the coursework exercise it grew from is not a better estimate but a map of where the estimates come from: the growth rate from the data, the infectious period from the prior, the reproduction number from the two together, the reporting fraction from the amplitude once the susceptible fraction is assumed, and the honesty of all the intervals from the observation model.
8 Limits of this study
One model. No age structure, no prior immunity, no spatial structure, no seasonality in transmission, no delay between infection and detection. The attack rate and the reporting fraction in particular depend on the assumption that everyone was susceptible, which the data cannot test.
One kind of count. Laboratory detections depend on who gets tested. The testing volume tripled across the wave, so the reporting fraction was not constant; the model absorbs the change into the negative-binomial variance, not into the mean.
One season. The 2022/23 season was unusually early and intense. The forecasting results describe how this model behaves on a sharp single wave, not on the double peaks and plateaus of other seasons.
Final data. The real-time refits used the counts as they stand now. Counts for recent weeks are revised upward for some time after first publication, so a genuine real-time forecast would have had less, and lower, data.
The weak prior is still a prior. Its range for the infectious period stops short of the likelihood’s ridge; a flatter prior would have followed the ridge further, and no finite prior settles a parameter the data do not identify.
Monte Carlo precision is reported (MCSE, ESS) and the simulation study used 50 seasons per model, so its coverage estimates carry Wilson intervals of about ±6 percentage points.
9 Glossary
Reproduction number,
The mean number of people one infectious person infects when (nearly) everyone is susceptible. Above 1 the epidemic grows. at the start of the season equals the basic reproduction number times the susceptible fraction.
Infectious period,
Mean days a person transmits. In the SIR model the generation interval between an infection and the infections it causes is exponential with mean .
Growth rate
The early exponential growth rate of infections, per day; the doubling time is divided by it.
Incidence and prevalence
New infections per week, against the number infectious at an instant. Detections count new cases, so the model’s expected count is built from incidence.
Reporting fraction,
Detections per infection. With the susceptible fraction fixed at one it absorbs that fraction too.
Background,
Detections a week not generated by the epidemic.
Overdispersion, negative binomial
Counts whose variance exceeds their mean; the negative binomial with size has variance and tends to the Poisson as .
Likelihood, MLE
The probability of the data as a function of the parameters; the parameter values that maximise it.
Profile likelihood, slice
The maximum log-likelihood as a function of one parameter with the others re-optimised; the slice holds the others fixed. Only the profile shows identifiability.
Final size
The share of the population infected by the end of an uncontrolled epidemic; for the SIR it solves .
Prior, posterior, shrinkage, overlap
What was believed before the data; what is believed after; one minus the ratio of posterior to prior variance; the shared area under the two densities.
MCMC, Metropolis, warm-up
Sampling the posterior by a random walk whose moves are accepted with a probability that depends on the posterior ratio; the initial phase during which the proposal adapts, discarded afterwards.
R-hat, ESS, MCSE
Between- to within-chain spread (should be near 1); the number of independent draws the chain is worth; the Monte Carlo standard error of a posterior mean, the posterior standard deviation divided by the square root of the ESS.
Credible interval, predictive interval
The central 95% of the posterior for a parameter; the central 95% of the distribution of a future count, which adds observation noise to parameter uncertainty.
Log score, CRPS, coverage
The log probability a forecast gave the outcome; the mean distance between forecast distribution and outcome; the share of outcomes inside a forecast interval.
Posterior predictive check
Comparing a statistic of the observed data with its distribution over data simulated from the fitted model.
Identifiability
Whether different parameter values produce different data (structural) and whether they do so strongly enough to be told apart with the data at hand (practical).
10 Reproduce it yourself
From the project folder: make setup installs the locked packages, make test runs the unit tests, make all runs every stage into output/ and make report renders this document. The stages and their outputs are listed in README.md. Every chain, restart and simulated season has its own seed, so a clean rebuild reproduces the result tables exactly; the timing tables differ by construction.
NoteTry it: walk along the ridge
source("parameters.R"); source("flu_model.R")Series <-read_flunet(); Data <-window_data(Series, "main")# the plausible optimum and a point on the ridge with the same growth rateth1 <-c(Re =1.41, D =3.87, iota =251, delta =0.00287, eps =37.5)r <- (th1[["Re"]] -1) / th1[["D"]]# the unrestricted optimum: much the same growth rate, a 71-day infectious period, and the other three re-fittedth2 <-c(Re =8.30, D =71.2, iota =2007, delta =0.00151, eps =19.1)c(r, (th2[["Re"]] -1) / th2[["D"]]) # 0.106 and 0.103 per daysapply(list(th1, th2), function(th) log_lik(th, Data, "Poisson")) # about -341 and -278: the second is far better# moving along the ridge without re-fitting the others does not work: D = 40 with th1's delta and iota is far worseth3 <- th1; th3[["D"]] <-40; th3[["Re"]] <-1+ r *40; log_lik(th3, Data, "Poisson")sapply(list(th1, th2), function(th) log_prior(log(th), para$PriorLit, "Poisson")) # and the prior says why it should not be
References
Biggerstaff, Matthew, Simon Cauchemez, Carrie Reed, Manoj Gambhir, and Lyn Finelli. 2014. “Estimates of the Reproduction Number for Seasonal, Pandemic, and Zoonotic Influenza: A Systematic Review of the Literature.”BMC Infectious Diseases 14: 480. https://doi.org/10.1186/1471-2334-14-480.
Carrat, Fabrice, Elisabeta Vergu, Neil M. Ferguson, et al. 2008. “Time Lines of Infection and Disease in Human Influenza: A Review of Volunteer Challenge Studies.”American Journal of Epidemiology 167 (7): 775–85. https://doi.org/10.1093/aje/kwm375.
Cook, Samantha R., Andrew Gelman, and Donald B. Rubin. 2006. “Validation of Software for Bayesian Models Using Posterior Quantiles.”Journal of Computational and Graphical Statistics 15 (3): 675–92. https://doi.org/10.1198/106186006X136976.
Cowling, Benjamin J., Vicky J. Fang, Steven Riley, J. S. Malik Peiris, and Gabriel M. Leung. 2009. “Estimation of the Serial Interval of Influenza.”Epidemiology 20 (3): 344–47. https://doi.org/10.1097/EDE.0b013e31819d1092.
Gneiting, Tilmann, and Adrian E. Raftery. 2007. “Strictly Proper Scoring Rules, Prediction, and Estimation.”Journal of the American Statistical Association 102 (477): 359–78. https://doi.org/10.1198/016214506000001437.
Haario, Heikki, Eero Saksman, and Johanna Tamminen. 2001. “An Adaptive Metropolis Algorithm.”Bernoulli 7 (2): 223–42. https://doi.org/10.2307/3318737.
Keeling, Matt J., and Pejman Rohani. 2008. Modeling Infectious Diseases in Humans and Animals. Princeton University Press.
Kermack, William Ogilvy, and Anderson Gray McKendrick. 1927. “A Contribution to the Mathematical Theory of Epidemics.”Proceedings of the Royal Society A 115 (772): 700–721. https://doi.org/10.1098/rspa.1927.0118.
King, Aaron A., Matthieu Domenech de Cellès, Felicia M. G. Magpantay, and Pejman Rohani. 2015. “Avoidable Errors in the Modelling of Outbreaks of Emerging Pathogens, with Special Reference to Ebola.”Proceedings of the Royal Society B 282 (1806): 20150347. https://doi.org/10.1098/rspb.2015.0347.
Krüger, Fabian, Sebastian Lerch, Thordis Thorarinsdottir, and Tilmann Gneiting. 2021. “Predictive Inference Based on Markov Chain Monte Carlo Output.”International Statistical Review 89 (2): 274–301. https://doi.org/10.1111/insr.12405.
Public Health Agency of Canada. 2023. “National Influenza Annual Report, Canada, 2022–2023: Canada’s First Fall Epidemic Since 2019.”Canada Communicable Disease Report 49 (10): 413–24. https://doi.org/10.14745/ccdr.v49i10a02.
Raue, Andreas, Clemens Kreutz, Thomas Maiwald, et al. 2009. “Structural and Practical Identifiability Analysis of Partially Observed Dynamical Models by Exploiting the Profile Likelihood.”Bioinformatics 25 (15): 1923–29. https://doi.org/10.1093/bioinformatics/btp358.
Reed, Carrie, Frederick J. Angulo, David L. Swerdlow, et al. 2009. “Estimates of the Prevalence of Pandemic (H1N1) 2009, United States, April–July 2009.”Emerging Infectious Diseases 15 (12): 2004–7. https://doi.org/10.3201/eid1512.091413.
Roberts, Gareth O., Andrew Gelman, and Walter R. Gilks. 1997. “Weak Convergence and Optimal Scaling of Random Walk Metropolis Algorithms.”Annals of Applied Probability 7 (1): 110–20. https://doi.org/10.1214/aoap/1034625254.
Roberts, Gareth O., and Jeffrey S. Rosenthal. 2009. “Examples of Adaptive MCMC.”Journal of Computational and Graphical Statistics 18 (2): 349–67. https://doi.org/10.1198/jcgs.2009.06134.
Somes, Melissa P., Robin M. Turner, Liam J. Dwyer, and Anthony T. Newall. 2018. “Estimating the Annual Attack Rate of Seasonal Influenza Among Unvaccinated Individuals: A Systematic Review and Meta-Analysis.”Vaccine 36 (23): 3199–207. https://doi.org/10.1016/j.vaccine.2018.04.063.
Talts, Sean, Michael Betancourt, Daniel Simpson, Aki Vehtari, and Andrew Gelman. 2018. Validating Bayesian Inference Algorithms with Simulation-Based Calibration. https://arxiv.org/abs/1804.06788.
Vehtari, Aki, Andrew Gelman, Daniel Simpson, Bob Carpenter, and Paul-Christian Bürkner. 2021. “Rank-Normalization, Folding, and Localization: An Improved for Assessing Convergence of MCMC (with Discussion).”Bayesian Analysis 16 (2): 667–718. https://doi.org/10.1214/20-BA1221.
Venzon, D. J., and S. H. Moolgavkar. 1988. “A Method for Computing Profile-Likelihood-Based Confidence Intervals.”Journal of the Royal Statistical Society: Series C (Applied Statistics) 37 (1): 87–94. https://doi.org/10.2307/2347496.
Vink, Margaretha A., Martinus Christoffel Jozef Bootsma, and Jacco Wallinga. 2014. “Serial Intervals of Respiratory Infectious Diseases: A Systematic Review and Analysis.”American Journal of Epidemiology 180 (9): 865–75. https://doi.org/10.1093/aje/kwu209.
World Health Organization. 2026. FluNet, Global Influenza Surveillance and Response System (GISRS). Https://www.who.int/tools/flunet.