Density Estimation Overview
Chapter 10 had no labels and asked for a compact representation. Chapter 11 has no labels either and asks for the density itself: the third of the book’s four pillars, “density estimation, where we are interested in modeling the distribution of the data.”
The chapter opens by admitting the obvious model is inadequate — a single Gaussian cannot have two bumps — and spends the rest of itself on what it costs to fix that.
What a mixture buys, and what it costs
Section titled “What a mixture buys, and what it costs”| one Gaussian | a mixture of | |
|---|---|---|
| parameters, , | ||
| modes | always | between and |
| fit on the kind of data Figure 11.1 shows | — | nats per point better |
| the maximum likelihood estimate | sample mean and sample variance, Equation 11.11 | does not exist |
| finding the parameters | one line | Sections 11.2, 11.3 and 11.4 |
The whole chapter follows from one structural fact. Equation 11.10 is
and the logarithm sits outside the sum over components. At it lands directly on the Gaussian and the answer is closed-form — confirmed against an optimiser to . At it cannot be moved inside, so the chain rule drags into every derivative, and every parameter’s stationarity condition mentions every other parameter.
Equation 11.20 is therefore a fixed point, not a formula. Measured: feeding the means back into their own update moves them by on the first round, then , then . A formula would move them by zero.
One quantity, six appearances
Section titled “One quantity, six appearances”The thread that runs through the chapter is a single ratio. Following it is most of understanding Chapter 11:
| where it appears | equation | page | what it is called there |
|---|---|---|---|
| the factor the chain rule drags into every derivative | 11.16 | 1102 | nothing yet — it has no name |
| defined and named | 11.17 | 1103 | the responsibility |
| a softmax of minus the energies, matched to | — | 1103 | a soft assignment |
| the weights in all three updates | 11.20, 11.30, 11.42 | 1104–1106 | importance weights |
| the E-step | 11.53 | 1107 | the E-step |
| the posterior over the latent , matched to | 11.69, 11.72b | 1108 | a posterior probability |
§11.2 discovers it as an algebraic nuisance. §11.4 shows it was a posterior all along, which is what retroactively licenses everything §11.2 did with it — summing responsibilities as if they were counts, differentiating a soft assignment, alternating at all.
Three updates, one derivation
Section titled “Three updates, one derivation”| §11.2.2 the means | §11.2.3 the covariances | §11.2.4 the weights | |
|---|---|---|---|
| the update | |||
| a weighted average of | the data | the squared deviations | nothing |
| needs a Lagrange multiplier | no | no | yes — |
| reads the data values | yes | yes | no |
| nats gained on the book’s example |
The three are the same argument at three moments. Only the weights are constrained — they live on a simplex — which is why only they need a multiplier. Contrast §10.2, where the multiplier was the answer: an eigenvalue, equal to the variance retained. Here is the normalising constant and carries no information at all.
Where the measuring pays off
Section titled “Where the measuring pays off”Every printed number in the book’s running example reproduces — , the responsibility matrix, all three update examples, “after five iterations”. Six things that turned up beyond them:
The maximum likelihood estimate does not exist. §11.5 says the likelihood “approaches infinity” when a component collapses onto a data point. Measured, it reaches at and keeps going. Of restarts on the book’s seven points, — — collapse a component, and every one reports a higher likelihood than every genuine fit. So the whole chapter is an algorithm for maximising something with no maximum, and page 1109 prices the usual patch: a variance floor buys exactly nats per decade.
The book’s own initialisation lands in the worse of two basins. Among the honest fits there are exactly two optima. Example 11.6 converges to ; another basin reaches , a better non-degenerate fit by nats.
One entry of Equation 11.19 disagrees with the arithmetic. At the book prints and ; the computed values are and . The largest disagreement across the printed matrix is — a rounding artefact, but the responsibility matrix is the one table in the chapter a reader is most likely to reproduce by hand.
Equation 11.30 does not say which mean it uses, and it matters by a factor of . The old means give , , ; the just-updated means give the book’s , , . The M-step’s ordering is the answer, and §11.3 states it only in the order the equations happen to appear.
Two conservation laws the chapter never states. After any M-step, exactly — the mixture’s mean is pinned to the sample mean. Stronger: the mixture’s variance equals the sample variance exactly, measured to over arbitrary responsibility matrices and every from to . EM cannot make the model wider or narrower than the data — it only redistributes spread between “within components” and “between components”, which is page 1101’s decomposition in motion.
The monotonicity guarantee, measured to the last bit. Over EM steps, register a negative change in . None exceeds , and the median decrease is — exactly one unit in the last place of a log-likelihood near . The theorem is about real numbers; a convergence test must compare against a tolerance and never against zero.
The pages
Section titled “The pages”| # | page | book section | the measured claim |
|---|---|---|---|
| 1101 | The Gaussian Mixture Model | §11.1 | two Gaussians merge into one bump at exactly apart |
| 1102 | Maximum Likelihood and Its Obstacle | §11.2 | optima on points; of restarts collapse |
| 1103 | Responsibilities | §11.2.1 | Equation 11.17 as written returns NaNs of |
| 1104 | Updating the Means | §11.2.2 | to |
| 1105 | Updating the Covariances | §11.2.3 | the mixture’s variance is the sample variance, always |
| 1106 | Updating the Mixture Weights | §11.2.4 | the multiplier is exactly , deviation |
| 1107 | The EM Algorithm | §11.3 | of steps go down, by one ULP |
| 1108 | The Latent Variable Perspective | §11.4 | the M-step is the exact argmax of , to |
| 1109 | Chapter 11 Worked Problems | §11.5 | eight problems, this module’s own |
| 1110 | Chapter 11 Formula Sheet | — | every equation and every measured constant |
What only the latent-variable view can do
Section titled “What only the latent-variable view can do”§11.4 arrives after the algorithm already works, which makes it easy to skip. It is not optional:
| what §11.2 has | what §11.4 adds | measured |
|---|---|---|
| , a ratio that appeared in a derivative | , a posterior | agreement |
| three weighted averages that work | the exact argmax of | over restarts |
| ” does not decrease” as an assertion | , so is a tight lower bound | |
| a fitted density | a generative process — and therefore a truth to recover | errors fall , , as grows |
That last row is the one that matters most in practice. Without a generative story you can measure a likelihood but you cannot ask whether the parameters are right. With one, you can generate data from known parameters, fit it, and watch the error fall — which is how every claim on pages 1107 and 1109 was checked.
What the chapter assumes, and what those assumptions cost
Section titled “What the chapter assumes, and what those assumptions cost”§11.5 is a page of caveats. Page 1109 runs each one:
| the assumption | measured |
|---|---|
| “the number of components is known” | held-out likelihood, BIC and AIC pick , and on one table |
| — and as grows | BIC reaches ; held-out likelihood peaks at and falls back to |
| — and on data that is not a mixture of Gaussians | a uniform asks for or ; a Student- asks for that mean nothing |
| the likelihood has a maximum | it does not, and a floor only prices the singularity |
| the components are distinguishable | every optimum has identical copies, spread |
| the non-parametric alternative | a KDE stores points to finish nats behind numbers |
The last two rows say something worth carrying forward. A GMM’s is a count only when the data really is made of groups; otherwise it is a budget for approximating a shape, and no criterion in the chapter can tell the difference. And the clustering reading of the GMM — component is a group, is a soft membership — is an interpretation the mathematics does not supply. §11.5’s own comparison to K-means is measured on page 1103: from the same starting means the two methods land apart and split seven points -- against effectively --, because K-means has no variances with which to weigh a tight cluster against a loose one.
Where it goes next
Section titled “Where it goes next”| §11.5’s pointer | and where it already appeared |
|---|---|
| K-means — the hard-assignment limit | page 1103 drove the variances to zero and measured the disagreement |
| nested cross-validation for choosing | page 1109 ran it, and found where it stops working |
| a Bayesian prior on the parameters | removes the singularity page 1102 measured; gives the model evidence BIC approximates |
| variational inference for the resulting posterior | Chapter 8’s §8.4, and the marginal likelihood of page 908 |
| EM for general latent-variable models | page 1108’s and never mention Gaussians |
| kernel density estimation | page 1109 put it on the same held-out set |
And the last pillar: Chapter 12 turns to classification, with support vector machines.
Recall card
Section titled “Recall card”- Chapter 11 estimates a density, the third pillar, and starts by admitting a single Gaussian often cannot do it.
- A mixture buys multimodality cheaply — 1.388610 nats per point for twelve extra parameters — and pays with the closed form.
- The logarithm in Equation 11.10 sits outside a sum over components, so it cannot reach the Gaussians, and every parameter’s equation ends up mentioning every other.
- So Equation 11.20 is a fixed point, not a formula. Feeding it back into itself moves the means by 4.295713 on the first round.
- One ratio appears six times under five names — a nuisance factor in a derivative, the responsibility, a softmax, an importance weight, the E-step, and finally a posterior.
- Section 11.4 is what licenses Section 11.2, retroactively: summing responsibilities as counts and differentiating a soft assignment are only legitimate because the responsibility is a posterior.
- The three updates are one derivation run at three moments, and only the mixture weights need a Lagrange multiplier because only they are constrained.
- EM conserves the data’s mean and its variance exactly, after every M-step, for every K. It only moves spread between within-component and between-component.
- The maximum likelihood estimate does not exist. The likelihood is unbounded above, 54.5 percent of restarts on seven points collapse a component, and every collapse outscores every honest fit.
- The monotonicity guarantee holds to one unit in the last place, so convergence must be tested against a tolerance rather than against zero.
- Overlap sets the convergence rate — 1045 iterations at 53 percent ambiguous against 3 at none — and a K-means initialisation removes the long tail.
- The chapter’s heaviest assumption is that K is known. Held-out likelihood is not even a consistent estimator of it, and on data that is not a mixture of Gaussians K stops being a count at all.
Start here: The Gaussian Mixture Model
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading