Hierarchical Inference in Gaussian Models
Summary
The parameters of a Gaussian model shape its posterior, but the “right” ones are usually unknown. Hierarchical inference places uncertainty on these hyperparameters and uses the marginal likelihood (evidence / type-II likelihood) to infer them. For the scalar mean and scale of a Gaussian, a conjugate prior (Gauss–Gamma; multivariate Gauss-inverse-Wishart) yields closed-form posterior updates and a Student- predictive. This is what lets a PN solver calibrate its uncertainty at runtime — cheaply estimating the one remaining scale so that its error bars are trustworthy.
Overview
A recurring PN thesis (Computation as Probabilistic Inference) is that classical methods arise from a family of Gaussian priors sharing one mean (the classical estimate) but differing in an overall uncertainty scale. The posterior standard deviation contracts at a rate tied to the classical convergence rate, differing only by that constant scale. If — and only if — that scale is calibrated well does the posterior variance become a trustworthy notion of numerical error. Hierarchical inference supplies the machinery to estimate it with minimal computational overhead, often during the solver’s run. Without it, PN uncertainty is arbitrary; with it, the error bars mean something.
Main Content
Hyperparameters and the evidence
In a Gaussian model , , the numbers that specify the model — mean , kernel (e.g. output scale , length-scale ), noise — are hyperparameters. The distinction between a variable (of interest) and a parameter (nuisance) is conceptual, not formal; so if is uncertain, assign it a distribution too. Integrating out gives the marginal likelihood (a.k.a. evidence or type-II likelihood) for :
Because this “models the model,” it is called hierarchical inference.
Hierarchical inference generally raises cost and yields a non-Gaussian (nonlinear) optimisation/inference problem. But for special cases — notably the scale and mean of a Gaussian — analytic forms exist via conjugate priors: priors whose posterior has the same functional form (only updated hyperparameters).
Scalar case: Gauss–Gamma conjugate prior
Gauss–Gamma prior and posterior
Let be i.i.d. from with unknown mean and variance , so . The conjugate Gauss–Gamma prior (hyperparameters ) puts a Gaussian on (variance ) and a Gamma on :
Multiplying by the likelihood and simplifying via the sufficient statistics — sample mean (Eq. 6.5) and sample variance (Eq. 6.6) — the posterior is again Gauss–Gamma, , with
Interpretation: and act as counters for how many observations have been collected (with the “pseudo-observations” encoded in the prior); are sufficient statistics for the population mean and variance. As , (sample mean) and the sample variance plus the correction , which corrects for the downward bias of .
Student- predictive
The predictive over the next sample , marginalising the posterior over , is a Student- distribution:
(Eq. 6.9.) Heavier tails than a Gaussian reflect the residual uncertainty about the variance .
Multivariate case
For i.i.d. from with unknown mean vector and covariance , the conjugate prior is the Gauss-inverse-Wishart, . The posterior is again Gauss-inverse-Wishart with and , and the predictive is a multivariate Student- (Eq. 6.12).
Hierarchical inference inside filters (the PN payoff)
Runtime scale calibration during filtering
For a linear-Gaussian state-space model, the marginal likelihood factorises over the Markov chain (prediction-error decomposition):
where the output scale (from the SDE’s , see Gauss-Markov Processes and SDEs) is factored out using a unit-scale predictive covariance (defined via ). With an inverse-Gamma prior , the posterior on updates recursively during the filtering pass:
In
Filter(Alg. 5.1) this is realised by using instead of and adding two scalar updates per step (initialised ). The corresponding Student- marginal on the state can be computed locally each step.
This is exactly why “runtime hyperparameter calibration matters for PN uncertainty”: the output scale — the single free constant that turns a contraction rate into an absolute error bar — is estimated on the fly with negligible ( per step) overhead, keeping the solver’s uncertainty well-calibrated.
Empirical Bayes vs full Bayes
- Empirical Bayes (type-II ML): pick a point estimate (maximise the evidence) and plug it in. Cheap; ignores hyperparameter uncertainty.
- Full Bayes: integrate over (the predictive Student- above), propagating hyperparameter uncertainty into the final answer. More faithful; here tractable thanks to conjugacy. One could iterate hierarchical layers ad infinitum, but this is not done in practice to keep cost finite.
Examples
Scaled-observation variant (Exercise 6.1)
If instead of one observes individually scaled samples with known scales , the same Gauss–Gamma machinery applies with modified sufficient statistics and . This heteroscedastic variant is exactly what appears when calibrating linear-solver uncertainty (§III).
Calibrating an ODE filter's error bars
An ODE filter with an IWP prior has an unknown diffusion scale governing how fast its uncertainty grows between steps. Running the recursive Gamma update (Eq. 6.14) alongside the Kalman filter yields a data-driven , so the solver’s reported credible intervals contract at the right absolute magnitude — the difference between a decorative error bar and a usable one.
Connections
- Infers the parameters of the Gaussians defined in Gaussian Distributions and Algebra, Gaussian Process Regression, and Gauss-Markov Processes and SDEs.
- The recursive-scale-in-filtering scheme feeds directly into ODE Filters and Smoothers and Theory of ODE Filters and Smoothers.
- Calibration of the remaining scale is applied in Uncertainty Calibration for Linear Solvers and Convergence and Priors in Bayesian Quadrature.
See Also
- Gaussian Process Regression — the model whose kernel hyperparameters are inferred here.
- Bayesian Filtering and Smoothing — where runtime scale calibration is embedded (Eq. 6.14).
- Uncertainty Calibration for Linear Solvers — the same idea for linear-algebra solvers.
- Computation as Probabilistic Inference — why calibrated scale makes PN error bars meaningful.