Idea: A posterior you cannot afford
The evidence sums over every and cannot be done; sampling all night is too slow.
- Variational inference turns the integral into an optimisation
- Pick a simple family, find the member closest to the posterior
Formula: KL divergence
Zero only when q matches p. Not symmetric: this one averages over q.
Formula: The evidence lower bound
Raise the bound and the divergence falls as much. The bound needs only prior times likelihood.
Example: The gap by hand
Joint , , over values of , and . How many bits is the gap to the evidence?
- Evidence: , its log is
- Bound:
- Gap:
Idea: The price of independence
Mean-field treats each parameter as independent: fast, with a known bias.
- It gets the mean right and the variance too small
- Its divergence punishes mass where p is thin, not parts of p it misses
Quick check: How narrow is it?
A normal posterior has and . What variance does the mean-field give ?
Show the answer
Answer:
The conditional variance: , less than half the truth.
Common mistake: Trusting a variational error bar
It is often too narrow, and most confident when correlation is strongest.
Instead Check against a short sampling run before sizing. Compare bounds only within one model.
Idea: Where it fits
Monte Carlo is slow but gets there. Variational inference is fast, and its bias stays.
- Use it for a posterior on a deadline
- Remember which way it leans: too confident
Courses / Simulation and approximation