Epi Simulation : Simulation-Based Inference for Epidemiology
SYNTHETIC BENCHMARK Checking connection

Static edition: Explore the prepared benchmark results below. Predictive simulation, source audit and checkpoint replay require the local version and cannot run on GitHub Pages.

EPI SIMULATION · SIMULATION-BASED INFERENCE FOR EPIDEMIOLOGY

Epi Simulation: Simulation-Based Inference for Epidemiology

A coordinated, step-by-step workbench for inferring epidemic parameters when mechanistic models have no tractable likelihood—bringing clarity to a fragmented SBI literature on which estimator to apply and how to structure an end-to-end validation workflow.

GLOBAL SCENARIO SWITCHER

Toggle the observation regime across the entire pipeline to see how a shift to 25% reporting (from 50%) affects all 14 estimators:

Currently viewing Matched (50% reporting): the simulator's reporting rate matches the true data-generating process.

WHY SBI IS NEEDED · INTRACTABLE LIKELIHOOD

Epidemic models do not have a closed-form likelihood p(Y | θ)

Stochastic epidemiological simulators (discrete-time chain-binomial SIR, Markov jump processes, stochastic-rate SDEs, and agent-based contact models) evolve hidden compartments (St, It, Rt) while surveillance only observes noisy daily counts Yt ~ Binomial(ΔIt, ρ). Evaluating the marginal likelihood p(Y1:T | θ) = ∑S,I,R p(Y, S, I, R | θ) requires summing over an exponentially large space of unobserved transmission histories. Because models do not have a tractable likelihood—only a forward simulator θ → Y—Simulation-Based Inference (SBI) is essential to learn or approximate posteriors directly from simulated outbreaks.

PROJECT RATIONALE · COORDINATION & STRUCTURE

Many papers, lack of coordination, and no clarity on which to apply or how to structure

Across the SBI literature, dozens of papers propose competing classical (ABC, BSL, BOLFI), neural (FMPE, NPE-NSF, NPE-MAF, NPSE, TSNPE, NLE, BNRE), and robust (RNPE, Generalised Bayes) methods across incompatible SIR formulations, priors, and unverified codebases. Practitioners face a lack of coordination with no clarity on which estimator to apply (especially when under-reporting breaks standard neural flows) and how to structure the workflow. This workbench coordinates 14 methods on one shared benchmark across 4 structured validation stages.

Loading the prepared 14-method SBI pipeline and visual diagnostics…
04 STAGE 4 · PROVENANCE, PAPER CODE AUDIT & REPLAY

Audit the code, trace the bundle & test replay.

Scientific validation goes beyond numbers: inspect pinned paper source code for equation drift, examine an inherited experiment bundle with a documentation discrepancy, and test bitwise replay.

PROVENANCE
4A PAPER-TO-CODE CORRESPONDENCE AUDIT

Follow a scientific claim into published source code (RSNL vs RNPE)

Does the time-varying reproduction number R₀(t) actually drive new infections in the pinned RSNL repository, compared to Ward et al.'s RNPE Julia code?

AST SOURCE AUDIT
Evaluate stochastic SIR drift sensitivity to R₀ in pinned paper files Parses rsnl_sir.py and rnpe_sir.jl via Python AST and evaluates dS/dt, dI/dt, dR₀/dt at R₀ = 0.5 vs R₀ = 2.0.
4B INHERITED EXPERIMENT BUNDLE & CAPTION DISCREPANCY

A posterior, inherited: compare the figure caption against the recorded run

Click any file in the bundle on the right to inspect its exact lines. Compare the reporting rate stated in README.md against config.json and run_manifest.json.

1-PARAM FMPE BUNDLE
TARGET FIGURE · SAVED BUNDLE

Transmission rate β (γ = 0.15 fixed)

FMPE · 21 DAYS

Waiting for the prepared posterior figure.

Comparing caption vs manifest reporting fraction… True β = 0.34 day⁻¹
Experiment bundle files (click to view source) 7 evidence files verified by SHA-256
Loading bundle…

Synthetic data · Click any file row to inspect line-by-line

Verify computational repeatability: Replay saved checkpoint (posterior.pt) Reloads the PyTorch flow-matching checkpoint with seed 314159 and compares 128 fresh draws against posterior_samples.npy.
VALIDATION SCORECARD · PIPELINE SUMMARY

Three questions. Different answers.

A reproducible file is a starting point—not proof that the epidemic model or posterior is valid.

i

Successful replay proves deterministic software execution, not calibration, parameter identifiability, or real-world validity.

⌁
1. Traceability & Provenance

Do the code, config, manifest & caption agree?

READY TO INSPECT
↻
2. Computational Replay

Does resampling posterior.pt match the saved baseline?

NOT CHECKED
✳
3. Statistical Adequacy

Is the estimator calibrated (SBC/TARP) and robust to reporting shift?

EVALUATED IN STAGE 3
QUICK GLOSSARY · KEY TERMS

The data and experiment are synthetic. All 14 estimators and validation checks are backed by SHA-256 verified artifacts.

Why SBI? (Intractable Likelihood)
Stochastic SIR models do not have a tractable likelihood p(Y | θ) because latent compartments (S, I, R) are unobserved. SBI infers parameters directly from forward simulations.
β, γ & R₀ = β/γ
Transmission rate (β), recovery rate (γ), and basic reproduction number (expected secondary cases per infection).
Matched (50%) vs Shifted (25%)
Models are trained assuming 50% of cases are reported. Under Shifted data, only 25% are reported—testing robustness to misspecification.
90% Coverage & SBC
Across 128 test outbreaks, a calibrated 90% credible interval should contain the true parameter ~90% of the time, with flat SBC rank histograms.
Joint TARP (IACE)
Tests joint 2D (β, γ) credible regions. Lower Integrated Absolute Coverage Error (IACE → 0) means better joint calibration.
RNPE Spike-and-Slab
Critiques each summary statistic, flagging scale summaries that conflict with epidemic timing under under-reporting.