VALIDATION · CALIBRATION

Is the inference
actually correct?

Simulation-Based Calibration: draw θ from the prior, simulate data, run inference, rank the truth among posterior draws. A calibrated procedure produces uniform ranks. Pick an engine below; each tab shows its KS distance to uniform per model cell and quantity, ranked by PIT.

How to read it

PIT RANKING

Scalar hyperparameters ranked by their PIT, cdf(marginal, truth). Required for grid/Laplace engines — INLA draws θ from a few integration-grid points, so naive sample ranks pick up a spurious staircase.

VERDICT (effect-size tiered)

within band = passes the Säilynoja et al. (2022) 95% simultaneous-band ECDF test. At ~10³ replicates that test detects even tiny error, so a fail is tiered by KS: minor ≤ 0.10 (approximation-level, fine), substantial > 0.10. The sparkline plots each cell's rank ECDF minus uniform against that band — a curve hugging zero inside the shaded band is calibrated.

REGIMES

Well-identified (more data informs the variance component) vs weak-identification stress (heavy prior, little data). Calibration is expected to degrade under stress.

:loglik

A joint data-dependent test quantity — the observation log-likelihood at (θ, x) — catching joint miscalibration the per-hyperparameter ranks miss.

Full nested-Laplace over a hyperparameter grid. The flagship — calibrated when the model is well-posed.

Well-identified

n_nodes 100 · PC u 1 · 500 replicates · 4 within band · 7 minor · 3 substantial

cellquantityECDF − z vs bandKSverdict
poisson_iidτ0.076minor
poisson_iidloglik0.058within band
poisson_rw1τ0.054minor
poisson_rw1loglik0.028within band
bernoulli_iidτ0.057minor
bernoulli_iidloglik0.058within band
bernoulli_rw1τ0.065minor
bernoulli_rw1loglik0.034within band
normal_iidnon-idτ0.401substantial
normal_iidnon-idσ0.333substantial
normal_iidnon-idloglik0.305substantial
normal_rw1τ0.063minor
normal_rw1σ0.058minor
normal_rw1loglik0.047minor

Weak-identification stress

n_nodes 30 · PC u 1 · 1000 replicates · 4 within band · 7 minor · 3 substantial

cellquantityECDF − z vs bandKSverdict
poisson_iidτ0.070minor
poisson_iidloglik0.038within band
poisson_rw1τ0.073minor
poisson_rw1loglik0.026within band
bernoulli_iidτ0.069minor
bernoulli_iidloglik0.027within band
bernoulli_rw1τ0.072minor
bernoulli_rw1loglik0.029within band
normal_iidnon-idτ0.302substantial
normal_iidnon-idσ0.267substantial
normal_iidnon-idloglik0.220substantial
normal_rw1τ0.075minor
normal_rw1σ0.067minor
normal_rw1loglik0.046minor

Notes

  • SBC ranked by PIT (cdf(marginal, truth)) for INLA/TMB; required because INLA's posterior θ is grid-quantized.
  • Verdict is effect-size tiered. ‘within band’ = passes the Säilynoja, Bürkner & Vehtari (2022) ECDF test with 95% SIMULTANEOUS confidence bands (rank ECDF inside the band at every point at once). At n≈10³ replicates that test detects even tiny error, so a cell failing it is tiered by KS effect size: ‘minor’ = KS ≤ 0.10 (≤10% max-CDF deviation — approximation-level, practically fine), ‘substantial’ = KS > 0.10. This separates an approximate-but-usable method from a genuinely-off one; a pure significance verdict would flag every approximation at this n.
  • hmc_laplace runs a leaner NUTS chain per replicate (offline cost); the well-identified regime (n=100 nodes) is prohibitively slow for per-replicate NUTS and is omitted.
  • Gaussian-IID (tagged ‘non-identified’) is a deliberate stress case: y~N(x,σ), x~N(0,1/τ) ⇒ only σ²+1/τ is identified. SBC against the EXACT posterior here is uniform (reference + harness validated), and a faithful sampler (hmc_laplace) recovers it (KS ~0.06); INLA's grid integration of the degenerate ridge does not (a finer grid barely helps), an inherent limit of grid-based hp exploration, not an implementation error. RW1 structure breaks the degeneracy and all engines recover.

Generated 2026-06-07 01:19 · benchmark/render_validation.jl

References