Case studies
These worked examples build complete models from the package's components and fit them with Turing. Most use real epidemic surveillance data and recreate published analyses; the Gaussian-process study instead fits data simulated from the model itself, where the point is to recover a known truth. Each one is self-contained and runs when the documentation is built, so the numbers you see are produced by the code on the page.
Sampling settings
To keep the documentation build to a sensible time, these case studies draw moderate NUTS samples (250 draws across 2 chains for the multi-chain fits, 200-300 for the single-chain ones). The target acceptance rate (adapt_delta) has been raised across these case studies to avoid divergent transitions. That is enough to demonstrate the models and produce stable figures; a real analysis would use more draws and check convergence diagnostics carefully.
They progress from a single renewal model to a layered observation process, a mechanistic compartmental model, and a flexible Gaussian-process latent:
Renewal model with negative-binomial reporting — a time-varying reproduction number
driven by an autoregressive latent process, mapped to infections through the renewal equation and observed with overdispersed counts. This is the canonical renewal model of Cori et al. [1] and Mishra et al. [2]. Reporting delays and day-of-week effects — the same renewal core wrapped in an observation model that convolves infections through reporting delays and modulates them with a day-of-week reporting pattern, in the style of real-time estimation tools [3].
Real-time nowcasting: correcting right-truncation — the same renewal core fit to a right-truncated real-time snapshot, contrasting a naive fit (which shows the artefactual recent-
down-turn) with a RightTruncate-corrected fit that removes it, again following real-time estimation practice [3].Multiple observation streams: cases, deaths, and strata — one renewal infection process observed through several named streams with a single
Splitconstruct, covering parallel streams (cases and deaths off shared infections), a cascade (deaths downstream of reported cases, achieved by placing the split lower in the pipeline), and data-driven strata (one stream per age band), motivated by the differing biases of surveillance streams [4].An SIR compartmental model — an alternative infection process where dynamics come from an ordinary differential equation solved by the SciML stack [5], following the Bayesian compartmental-inference example of Chatzilena et al. [6].
A Gaussian-process latent process — plugs a Hilbert-space approximate Gaussian process [7] into the renewal model as the latent
process, fits it under NUTS with Mooncake, and checks it against an exact GP and against the simulated latent.
Every example uses the same recipe: assemble components into a model, call as_turing_model (directly or through IDModel / IDProblem), simulate by passing missing data, and fit by passing observed data and sampling. Because the components share one interface, you swap a modelling assumption by swapping a struct — the Composable design page explains the mechanism.
References
The methods these case studies recreate and adapt are described in the following works. Individual pages link back to the relevant entries here. 2. A. Cori, N. M. Ferguson, C. Fraser and S. Cauchemez. A new framework and software to estimate time-varying reproduction numbers during epidemics. American Journal of Epidemiology 178, 1505–1512 (2013).
S. Mishra, T. Berah, T. A. Mellan, H. J. Unwin, M. A. Vollmer, K. V. Parag, A. Gandy, S. Flaxman and S. Bhatt. On the derivation of the renewal equation from an age-dependent branching process: an epidemic modelling perspective, arXiv preprint arXiv:2006.16487 (2020).
S. Abbott, J. Hellewell, R. N. Thompson, K. Sherratt, H. P. Gibbs, N. I. Bosse, J. D. Munday, S. Meakin, E. L. Doughty, J. Y. Chun and others. Estimating the time-varying reproduction number of SARS-CoV-2 using national and subnational case counts. Wellcome Open Research 5, 112 (2020).
K. Sherratt, S. Abbott, S. R. Meakin, J. Hellewell, J. D. Munday, N. Bosse, M. Jit and S. Funk. Exploring surveillance data biases when estimating the reproduction number: with insights into subpopulation transmission of COVID-19 in England. Philosophical Transactions of the Royal Society B 376, 20200283 (2021).
C. Rackauckas and Q. Nie. DifferentialEquations.jl – a performant and feature-rich ecosystem for solving differential equations in Julia. Journal of Open Research Software 5 (2017).
A. Chatzilena, E. van Leeuwen, O. Ratmann, M. Baguelin and N. Demiris. Contemporary statistical inference for infectious disease models using Stan. Epidemics 29, 100367 (2019).
G. Riutort-Mayol, P.-C. Bürkner, M. R. Andersen, A. Solin and A. Vehtari. Practical Hilbert space approximate Bayesian Gaussian processes for probabilistic programming. Statistics and Computing 33, 17 (2023).
K. Charniga, S. W. Park, A. R. Akhmetzhanov, A. Cori, J. Dushoff, S. Funk and others. Best practices for estimating and reporting epidemiological delay distributions of infectious diseases. PLoS Computational Biology 20, e1012520 (2024).
T. E. Loman, Y. Ma, V. Ilin, S. Gowda, N. Korsbo, N. Yewale, C. Rackauckas and S. A. Isaacson. Catalyst: Fast and flexible modeling of reaction networks. PLoS Computational Biology 19, e1011530 (2023).
A. Solin and S. Särkkä. Hilbert space methods for reduced-rank Gaussian process regression. Statistics and Computing 30, 419–446 (2020).