Model
Two blocks fitted to the 2012 Isiro BDBV line list (n = 52):
Four atomic delay components, fitted via per-case latent event times (
, , , , , sampled where observed) within their respective day windows. Latents are shared across that case's delays, so the natural-history identity holds per case for every posterior draw.Stratified case-fatality: Bernoulli outcome with a logistic link on HCW status, case definition (Probable vs Confirmed), and standardised age.
Three parametric families are supported (:lognormal, :gamma, :weibull), selected via the family keyword to bdbv_model. The canonical run uses Gamma — lowest WAIC.
bdbv_model_stratified(d; family) adds a per-delay log-mean shift double_interval_censored formulation; see Limitations.)
Common parametrisation across families
All three families share a log-location / log-shape parametrisation so the priors are comparable. The latent log-location
| Family | Latent pair | Distribution constructed |
|---|---|---|
| LogNormal | ||
| Gamma | ||
| Weibull |
Here
For Weibull,
Compound delays via convolution post-processing
The model fits only the four atomic components — the natural-history identity
| Symbol | Component | |
|---|---|---|
| onset → admission | 40 | |
| admission → death | 22 | |
| admission → discharge | 15 | |
| onset → notification | 38 |
The marginal compound distributions
In-hospital length of stay via mixture post-processing
The length of stay in hospital (admission → departure) is the time an admitted case occupies a bed before leaving, by either death or discharge. It is derived in post-processing as a two-component mixture of the fitted d_ad (admission → death) and d_ac (admission → discharge), with the mixing weight set by the in-hospital fatality among admitted cases:
d_los = w · d_ad + (1 − w) · d_ac, w ~ Beta(1 + n_died, 1 + n_discharged)w is the conjugate posterior on the admitted-case fatality fraction (n_died = 22, n_discharged = 15), drawn once per posterior draw so the marginal propagates uncertainty in both the delay distributions and the fatality share. Sampled per draw (500 realisations) like the convolved marginals. The fatal and survivor pathways are reported separately alongside the overall mixture.
Priors
Weakly informative, centred on a plausible day count for each delay. The prior_scale keyword (default
with one scale-parameter prior per family,
and CFR coefficients
where the last is the per-delay HCW log-mean shift in the stratified model only.
The
Likelihood
For each case
where any latent whose event is unobserved for case
For each ordered pair
where
Each bounded prior carries a Jacobian
See Park et al. 2024 (medRxiv 2024.01.12.24301247) §2.3.3 for the latent-variable formulation that this builds on.
CFR block. For each case
The standardised age
Inference
NUTS via Turing.jl. Defaults:
1000 post-warmup samples per chain
4 chains in parallel (
MCMCThreads)target_accept = 0.95AutoForwardDiff()AD backendDynamicPPL.InitFromPrior()with a different RNG per chainSeed 20260519 (parent), per-chain seeds derived from a child
MersenneTwistersoRandom.seed!is never called on the global RNG
About 1–2 minutes per family on a laptop. max R̂ ≤ 1.002, min bulk ESS ≥ 3,200, 0 divergent transitions across families.
The diagnostics are: R̂ (the ratio of between-chain to within-chain variance — values near 1 indicate the four chains agree on the posterior), bulk ESS (effective sample size in the body of the distribution — values in the thousands indicate the chain has explored the posterior efficiently), and divergent transitions (HMC steps that hit numerical instability — zero divergences across all fits means the geometry is well-behaved).
Model comparison
WAIC is computed pointwise: for each observation, the per-draw log-likelihood is evaluated from the per-draw distribution parameters, and
PSIS-LOO would be preferable but adds dependencies; WAIC is adequate here.
Post-processing
For each atomic delay the script reports the posterior median, mean, and (for LogNormal) log-SD with 95% CrI. Gamma and Weibull medians come from the per-draw inverse-CDF at 0.5.
For each derived marginal (
For the in-hospital length of stay (summarise is given the model input d.
For the CFR block the script reports the log-OR coefficients and the implied marginal CFR at each combination of HCW status and case definition, with age held at its sample mean.