Skip to content
BIASED

The Laplace approximation and Bayesian classification

Block 1 of 7~2 min

Where conjugacy ends

In the topics Bayesian linear regression and The relevance vector machine every step was exact. A Gaussian likelihood times a Gaussian prior gave a Gaussian posterior, and the evidence was a Gaussian integral. Classification breaks this at the first step.

Let the labels be ti∈{0,1}t_i \in \{0, 1\} and let the model say

p(ti=1∣w)=σ(w⊤φ(xi))=yi,σ(a)=11+e−a.p(t_i = 1 \mid w) = \sigma\big(w^\top \varphi(x_i)\big) = y_i, \qquad \sigma(a) = \frac{1}{1 + e^{-a}}.

This is logistic regression. The likelihood of all labels is a product of Bernoulli terms, and with the usual prior N(0,α−1I)\mathcal N(0, \alpha^{-1} I) the posterior is

p(w∣t)∝∏i=1nyiti(1−yi)1−ti⋅exp⁡(−α2 w⊤w).p(w \mid t) \propto \prod_{i=1}^{n} y_i^{t_i} (1 - y_i)^{1 - t_i} \cdot \exp\Big(-\frac{\alpha}{2}\, w^\top w\Big).

The logarithm of a sigmoid is not quadratic in ww, so this is not a Gaussian. No prior over ww is conjugate to it. Two integrals that were routine before now have no closed form: the normalizer p(t)=∫p(t∣w) p(w) dwp(t) = \int p(t \mid w)\, p(w)\, dw, which is the evidence, and the predictive probability ∫σ(w⊤φ(x∗)) p(w∣t) dw\int \sigma(w^\top \varphi(x_*))\, p(w \mid t)\, dw.

This topic replaces the posterior with a Gaussian chosen locally: centred at the posterior mode, with a width read off the curvature there. That is the Laplace approximation. It gives an approximate posterior, an approximate evidence and, for classification, a predictive probability that knows how uncertain the weights are.

Answers are saved on the server and tied to this browser until you sign in.