Data-Averaged Posterior Self-Consistency
Summary
The foundational identity behind SBC: for any model, the average of the exact posterior over data generated from the Bayesian joint distribution equals the prior. Equivalently, the data-averaged posterior equals the prior distribution. Any discrepancy between a computed data-averaged posterior and the prior signals an error — inaccurate posterior computation or a mis-implemented model.
Overview
The most direct way to validate a computed posterior would be to compare computed expectations to exact ones — but exact posterior expectations are known only for the simplest models, which have atypical structure. So we need a validation criterion that does not require any known property of the true posterior. The Bayesian joint distribution provides exactly such a self-consistency condition: integrating exact posteriors over data drawn from the joint distribution recovers the prior, regardless of the model’s structure.
Main Content
Self-consistency of the data-averaged posterior (Eq. 1)
Let the Bayesian joint distribution be , where is the prior and the likelihood (data-generating process). Draw a ground truth from the prior, , and data from the corresponding process, . Then integrating the exact posterior over the joint distribution returns the prior:
Equivalently, for any model the average of any exact posterior expectation, with respect to data generated from the Bayesian joint distribution, reduces to the corresponding prior expectation.
Notation.
- — model parameters (possibly multidimensional); — measurements/data.
- — prior; — likelihood; — joint.
- — a ground-truth parameter draw from the prior; — a dataset simulated from the likelihood at .
- — the exact posterior given .
- The inner factor is the joint density of the simulated pair; integrating it against the exact posterior marginalizes the data and recovers the prior over .
Why it holds (sketch). is the prior predictive (marginal) density of the data; then . The exact posterior and the marginal data density “cancel” back to the prior. The identity is a tautology for the exact posterior — which is precisely what makes any observed deviation diagnostic of computational error.
Data-averaged posterior
The data-averaged posterior is the left-marginalized object computed using the algorithm under test. Under exact computation it equals the prior . A computed data-averaged posterior that is over-dispersed, under-dispersed, or shifted relative to the prior reveals the corresponding error in the inference (see Interpreting SBC Histograms, Figs. 5-7).
This consistency between the data-averaged posterior and the prior is not novel — it was exploited by Geweke (2004) (via a Gibbs sampler on the joint distribution) and Cook, Gelman & Rubin (2006) (via posterior CDF values). SBC replaces those artifact-prone comparisons with a rank-statistic test (see Rank Statistics and Uniformity).
Examples
Reading the identity as a validation target
Setup: Run any algorithm over many pairs drawn from the joint distribution and aggregate the computed posteriors. Result (exact case): The aggregated (data-averaged) posterior is indistinguishable from the prior. Interpretation: This holds for every model with no need to know any true posterior expectation. It gives a generic, model-agnostic validation target — the basis on which SBC, Geweke, and Cook-Gelman-Rubin all rest.
Connections
- Used by: Simulation-Based Calibration - Overview (motivation); Rank Statistics and Uniformity (the rank test is the practical embodiment of this identity); The SBC Algorithm (sampling then realizes the joint draw).
- Interpretation: Deviations of the computed data-averaged posterior from the prior map to histogram shapes in Interpreting SBC Histograms.
- Lineage: Geweke (2004), Cook, Gelman & Rubin (2006).