Marginal Likelihood (Evidence)
Given a model with prior and likelihood , the marginal likelihood (also called evidence, prior predictive density, or model evidence) is the prior-weighted average of the likelihood,
It is the normalizing constant in Bayes’ rule: . It is the probability of the observed data under the model before any is committed to. Three roles:
- Hyperparameter estimation (empirical Bayes). Maximizing over tunes the prior to the data. The resulting Type-II MLE is used as a plug-in for unit-level inference. This is the standard way to choose Dirichlet concentrations, Beta-Binomial pseudo-counts, Gaussian-prior variances, or Gaussian-process kernel lengthscales in practice.
- Model comparison. The ratio of evidences for two models is the Bayes factor , which Bayesians use to quantify how strongly the data favor one model over another.
- Posterior normalization. It is the denominator of Bayes’ rule. In conjugate models it is closed form; in non-conjugate models it is computed by Laplace approximation, bridge sampling, or nested sampling.
Closed-form evidence in conjugate families. When and form a conjugate pair, the evidence has a clean ratio-of-normalizing-constants form. For the Beta-Binomial: . For the Gamma-Poisson: . For the Dirichlet-Multinomial: .
Laplace approximation. When closed form is unavailable,
where is the MAP and the Hessian is evaluated there. See 3.9 Laplace Approximation.Asymptotic approximation — BIC. For large with a proper prior,
which is the Bayesian Information Criterion. BIC approximates evidence to within an error, giving a fast model-comparison surrogate that trades off fit against dimension.
Prerequisites
- 3.1 Bayesian Framework — Bayes’ rule, prior, posterior, evidence.
- 3.3 Bayes Factors — ratio of evidences used for model comparison.
- 3.9 Laplace Approximation — standard tool for approximating evidence when closed form is unavailable.
Intuition
The marginal likelihood measures how well a model predicts the observed data before any parameters are fit. It is the average likelihood across all parameter values the prior considers plausible. A model that concentrates its prior on values producing the observed data receives high evidence; a model that spreads its prior over regions of parameter space far from the data’s implications receives low evidence, because most of the prior mass is “wasted.”
This produces an automatic Occam-razor effect that no frequentist model-selection criterion gets for free. A flexible model with many parameters can fit almost any dataset, but its prior must spread mass across the whole parameter space — so the prior density at any particular is small. A simpler model has less flexibility but concentrates its prior predictions, so prior density near the truth is larger. The marginal likelihood weighs fit against how sharply the prior had to be tuned to produce that fit, and rewards the model that used its flexibility efficiently. This is the formal content of the 3.3 Bayes Factors “built-in Occam” property.
When the prior has hyperparameters , viewing as a function of yields a standard likelihood function for alone — the “marginal” in marginal likelihood is over . Maximizing this likelihood picks the prior that best explains the observed data, which is the empirical-Bayes recipe. In conjugate models the maximization is analytic; in non-conjugate models it reduces to numerical optimization of a (usually log-concave) function.
Properties
(Prior Predictive) Evidence is literally the prior-averaged likelihood.
This is the probability of before the data is used, with uncertainty about integrated out per the prior. It is not a function of — that has been integrated away. It is a function of (and the observed ). The term “prior predictive density” is sometimes preferred for this reason.
(Closed Form in Conjugate Families) Each conjugate pair has an evidence expression in terms of ratios of normalizing constants.
For the Beta-Binomial:
For the Gamma-Poisson with i.i.d. counts and unit exposure:
For the Normal-Normal with known :
with and the posterior parameters. These closed forms allow Type-II MLE over by simple root-finding.
(Empirical-Bayes Estimator) Maximizing evidence over gives the Type-II MLE.
In the Beta-Binomial hierarchy, the first-order condition involves the digamma function : setting and gives two digamma equations solved numerically by Newton’s method. The Type-II MLE is then used as a plug-in prior; see 3.6 Hierarchical Models.
(Built-in Occam Penalty via BIC) Evidence penalizes model dimension logarithmically via the Laplace approximation.
For a proper prior on with log-likelihood smooth and growing, the Laplace approximation gives
Hence , recovering the BIC. Evidence thus performs model selection that rewards fit and penalizes dimension — an asymptotic surrogate for the full Bayes factor that needs only the MLE and the dimension of . See 3.9 Laplace Approximation and 3.3 Bayes Factors.
(Log-Evidence Decomposes as Prequential Prediction) Total evidence equals the sum of one-step-ahead predictive log-likelihoods.
By the chain rule,
where each term is the posterior-predictive likelihood conditional on all earlier data. This prequential or leave-future-out decomposition is a Bayesian version of cross-validation: the evidence is the cumulative predictive accuracy along the data stream. Two models with comparable overall evidence but different prequential profiles differ in when they predict well — useful diagnostic information.
(Computation in Non-Conjugate Models) Without conjugacy, evidence is computed by Laplace, thermodynamic integration, bridge sampling, or nested sampling.
- Laplace: ; fast and accurate when posterior is approximately Gaussian. See 3.9 Laplace Approximation.
- Bridge sampling / thermodynamic integration: interpolate between prior and posterior and integrate; robust for multimodal posteriors.
- Nested sampling (Skilling 2006): evaluate at decreasing prior-mass levels; standard in astrophysical inference.
- Harmonic-mean estimator: ; infamous for infinite variance and should not be used without stabilization.
(Evidence Depends on the Prior, Not Just the Likelihood) Unlike the posterior for a well-identified parameter, evidence is sensitive to prior choice.
As the prior width , evidence at rate (the prior spreads mass ever more thinly). Two models with identical likelihoods but different prior widths therefore have different evidences, and the Bayes factor inherits this sensitivity — the source of the Jeffreys-Lindley paradox in 3.3 Bayes Factors. Weakly informative priors, not improper ones, are mandatory for Bayes-factor analyses.
(Marginal Likelihood Under Improper Priors Is Undefined) Model comparison via Bayes factors requires proper priors.
If is improper, the evidence is finite only if the likelihood is integrable in , and the result has no absolute scale. The Bayes factor then inherits an arbitrary scaling constant. Posterior inference within a single model is immune to this (the normalizing constant cancels), but cross-model comparison is not. See the 3.3 Bayes Factors Jeffreys-Lindley discussion for what to do when only improper priors feel principled.
Examples
Example 1: Beta-Binomial Evidence and Hyperparameter Estimation
A single binomial observation with a prior has evidence
For , , and the non-informative uniform prior :
This is exactly what the uniform prior on predicts: if is uniform, then is uniform on , and .Empirical Bayes over a hierarchy: With groups , , the hierarchical evidence is . Its log-derivatives involve digamma functions:
and similarly for . Setting both to zero and solving numerically gives ; Newton iteration converges in a handful of steps.
Example 2: Evidence for Model Comparison
Compare (point null) against with under i.i.d. observations with sample mean . The evidences are
Their ratio is the Bayes factor
which exhibits the Jeffreys-Lindley paradox: for fixed (frequentist significance), as , i.e. a vague prior on guarantees evidence against any non-null hypothesis regardless of the data’s frequentist strength.
Example 3: BIC as a Fast Proxy for Log-Evidence
A Bayesian linear regression with predictors on observations has log-likelihood at the MLE . BIC is
For two nested models with predictors, the approximate log-evidence difference is
The penalty for each additional parameter means that as grows, BIC (and asymptotic evidence) ever-more-strongly prefers the smaller model unless the larger model’s likelihood improvement also grows with . This is stricter than AIC ( per parameter, no ), and matches the evidence’s own Occam penalty.
Derivation
Goal: derive the Laplace approximation for evidence.
The posterior is proportional to , and the evidence is . Write and let be its maximizer (the MAP). Taylor-expanding around to second order:
where is the Hessian (negative definite at a maximum). Exponentiating and integrating:
Since ,
Asymptotic BIC derivation. For i.i.d. observations, where is order 1. Taking logs:
All - and -independent terms are absorbed into a constant; the prior term does not grow with . The dominant terms are and , giving BIC.
See Also
- 3.1 Bayesian Framework — evidence as the Bayes-rule normalizing constant.
- 3.3 Bayes Factors — evidence ratio for model comparison.
- 3.9 Laplace Approximation — standard approximation when evidence has no closed form.
- 3.5 Conjugate Families — conjugate pairs admit closed-form evidence.
- 3.6 Hierarchical Models — empirical Bayes plugs in the evidence-maximizing hyperparameters.
- 3.11 MCMC — full-Bayes alternatives to plugging in the Type-II MLE.