ID-5-02 (TO) · Mathematical Foundations of Diffusion Models · W02 demo

The Likelihood Lens

One function, f(x; μ) — read along x it is a density; read along μ it is a likelihood. The entire confusion, dissolved by two slices of the same surface.

Act I · Two slicesThe same surface, sliced both ways

The heatmap is f(x; μ) = N(x; μ, σ²) over the (x, μ) plane. Drag the two lines. The horizontal slice (fix μ, vary x) is the pdf — a distribution over data, area = 1. The vertical slice (fix the observed x, vary μ) is the likelihood — a ranking of parameters, whose area means nothing.

f(x; μ) — drag the slice lines pdf slice (μ fixed) likelihood slice (x fixed)

pdf: μ fixed at 0.0

likelihood: x observed at 1.0

For the Gaussian the two slices happen to have the same bell shape — a coincidence of the symmetry f(x; μ) = f(μ; x), not a general fact. What is always true: the blue slice integrates to 1; the orange one need not.

Act II · A datasetLikelihood of n points: drag them, watch the peak

With data x₁, …, x₆ the log-likelihood is ℓ(μ) = Σᵢ log f(xᵢ; μ) — a downward parabola in μ. Drag the data points and watch the maximizer track one statistic and nothing else: the sample mean.

log-likelihood ℓ(μ) · drag the points on the axis ℓ(μ) data points
σ changes how sharp the parabola is — never where its peak sits. The maximum-likelihood estimate of μ is the sample mean, whatever σ is. (Tonight's exercise: prove it by differentiating ℓ.)

The one-sentence summary. The pdf and the likelihood are the same formula read along different axes: fix parameters, vary data → a distribution; fix the observed data, vary parameters → a score for fitting. The likelihood is not a probability distribution over μ — only its argmax (and shape near it) carries meaning.