For Bayesian linear regression with prior w∼N(0,α−1I) and noise precision β, derive the log evidence ln⁡p(t∣α,β). Which terms reward fit, and which penalise complexity?

Probabilistic models, Model evidence
Level L4 Advanced. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can evaluate a Gaussian integral by completing the square and interpret the Occam factor −12ln⁡∣A∣.

Key idea

Write the integrand as exp⁡(−E(w)) and complete the square around the posterior mean: E(w)=E(mN)+12(w−mN)⊤A(w−mN) with A=αI+βΦ⊤Φ. The integral then gives (2π)M/2∣A∣−1/2.

Steps

  1. The evidence is p(t)=∫p(t∣w) p(w) dw, with M weights and N data points.
  2. The two densities give prefactors (β2π)N/2(α2π)M/2 times exp⁡(−E(w)), where E(w)=β2∥t−Φw∥2+α2w⊤w.
  3. E is quadratic in w with Hessian A=αI+βΦ⊤Φ and minimum at mN=βA−1Φ⊤t. So E(w)=E(mN)+12(w−mN)⊤A(w−mN).
  4. The Gaussian integral: ∫exp⁡ ⁣(−12(w−mN)⊤A(w−mN))dw=(2π)M/2∣A∣−1/2.
  5. Take logs: ln⁡p(t∣α,β)=M2ln⁡α+N2ln⁡β−E(mN)−12ln⁡∣A∣−N2ln⁡2π.
  6. Interpretation: −E(mN) rewards fit (low squared error and small weights). The term −12ln⁡∣A∣ penalises complexity. Since A=αI+βΦ⊤Φ, it grows with the number of well-determined weights, so more flexible models are charged more.
  7. We choose α and β (or the number of features) by maximising this evidence, with no validation set. As a check, with M=1, α=1, β=4 and the data (1,2),(2,3), we get A=21 and ln⁡∣A∣=3.04.

Common mistakes

How long your answer should be

A page. About 8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: In mean-field variational inference, with q(z)=∏jqj(zj), show that the optimal factor satisfies ln⁡qj∗(zj)=Ei≠j[ln⁡p(x,z)]+const. How is this used as an algorithm?
Next in Probabilistic models: Derive the log marginal likelihood of a GP regression model with y∼N(0,Ky), Ky=K+σ2I, and its gradient with respect to a kernel hyperparameter θ. How do the data-fit and complexity terms trade off as the length-scale grows?