Skip to content

Model

Two blocks fitted to the 2012 Isiro BDBV line list (n = 52):

  1. 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.

  2. 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 so HCW and non-HCW cases share the shape parameter but can differ on the central tendency. (This variant still uses the marginalised 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 (LogNormal: log-median ) and log-shape map to the natural parameters   (or ) and  :

FamilyLatent pairDistribution constructed
LogNormal
Gamma
Weibull

Here uses the shape-scale parametrisation (mean ); uses shape and scale (mean   ). For LogNormal, is the median and the log-scale standard deviation.

For Weibull, is truncated to   so   stays well-defined. The Weibull stratified model is not supported.

Compound delays via convolution post-processing

The model fits only the four atomic components — the natural-history identity    (and likewise   ) holds per case by construction, so fitting onset → death separately would just duplicate the information already in the shared latents.

SymbolComponent
onset → admission40
admission → death22
admission → discharge15
onset → notification38

The marginal compound distributions    and    ( denoting convolution) are derived in post-processing as sample-level convolutions of the population atomic distributions. The mean of the convolved marginal equals the sum of the atomic means by linearity of expectation; medians and quantiles come from Monte Carlo (500 samples per posterior draw).

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  ) scales the SDs jointly:

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   default on the log-medians gives roughly threefold prior latitude either way on the central tendency. A 3-scale sensitivity sweep ( ) shifts posterior means by less than 5%.

Likelihood

For each case with reported day for event  , sample the within-day latent times in reverse-chain order with Sam Abbott's bounded-primary trick — the secondary event time bounds the primary's upper window edge directly, so the support is smoothly parametrised and NUTS doesn't see the wedge-shaped corner that the naive ordering constraint   would produce at same-day cases. For each case, with the (possibly-tightened) upper edge ,

where any latent whose event is unobserved for case is dropped.

For each ordered pair both observed in case , the delay likelihood contributes

where is the density of the fitted delay distribution for that ordered pair (the four atomic components ).

Each bounded prior carries a Jacobian , which restores the implicit independent-uniform-over-day-window prior of the equivalent marginalised double-interval-censoring model. The Jacobian vanishes for multi-day cases (where   ) and only contributes when the ordering constraint binds (6 same-day cases here).

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 with outcome  , HCW indicator , probable-case indicator , and standardised age ,

The standardised age has sample mean 0 and SD 1, with the population mean imputed for the 3 of 52 missing ages. is clamped to   so the Bernoulli's domain check doesn't fail when NUTS proposes large during warmup.

Inference

NUTS via Turing.jl. Defaults:

  • 1000 post-warmup samples per chain

  • 4 chains in parallel (MCMCThreads)

  • target_accept = 0.95

  • AutoForwardDiff() AD backend

  • DynamicPPL.InitFromPrior() with a different RNG per chain

  • Seed 20260519 (parent), per-chain seeds derived from a child MersenneTwister so Random.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      aggregated across the 167 observations (    atomic delays outcomes).

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 (   and   ) the script samples 500 realisations per posterior draw from the convolution and reports median, mean, SD, and 95th percentile with 95% CrI across draws.

For the in-hospital length of stay () the script reports the fatal pathway (), the survivor pathway (), and the overall mixture (median, mean, SD, 95th percentile with 95% CrI), along with the in-hospital fatality weight. Supplied only when 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.