Updating the Mixture Weights
Two updates down, one to go — and this one is different. The means and covariances were unconstrained, so setting a derivative to zero was enough. The weights have to stay on a simplex, so §11.2.4 is the only place in the chapter that reaches for Chapter 7.
What you’ll learn
Section titled “What you’ll learn”- Theorem 11.3, Equation 11.42, and Example 11.5 reproduced: , which round to the book’s , and .
- The Lagrangian of Equations 11.43–11.48, and solved from each component separately: exactly , all three agreeing to .
- Why the constraint is not a formality: the gradient of in is strictly positive in every coordinate, so unconstrained ascent sends every weight to infinity.
- Why no projection onto the simplex is ever needed afterwards: measured over random responsibility matrices, the weights sum to to and none ever leaves .
- What this update alone is worth: nats, the smallest of the three.
- The complete cycle, matching the book’s own figures: negative log-likelihood , printed as .
- And the one structural thing that separates this update from the other two: it never looks at .
Intuition: counting, not averaging
Section titled “Intuition: counting, not averaging”The first two updates asked where and how wide. This one asks how much, and the answer is the one you would write down without any calculus: the share of the data each component ended up owning.
is that share — page 1103’s effective count. Divide by and you have a proportion. The Lagrange multiplier’s entire job is to confirm that the obvious answer is also the optimal one, and the multiplier it produces, , is exactly the normalising constant you would have divided by anyway.
flowchart TD A["mu_k: unconstrained in R^D"] --> B["set dL/dmu = 0
Theorem 11.1"] C["Sigma_k: must be PSD"] --> D["set dL/dSigma = 0
Theorem 11.2 -- PSD comes free"] E["pi_k: must lie on the simplex"] --> F["dL/dpi is positive everywhere
no interior stationary point"] F --> G["Lagrangian, Equation 11.43
lambda = -N"] G --> H["pi_k = N_k / N
Equation 11.42"]
§11.2.4 Theorem 11.3
Section titled “§11.2.4 Theorem 11.3”Theorem 11.3 (Update of the GMM Mixture Weights). The mixture weights of the GMM are updated as
The proof accounts for with a Lagrange multiplier:
Setting both partials to zero gives and , so , and since :
Measured, solving from each component independently:
| from | |
| from | |
| from | |
with a largest deviation of , and Equation 11.44b’s stationarity condition equal to in every component.
| before | after | the book | ||
|---|---|---|---|---|
summing to .
The constraint is doing real work
Section titled “The constraint is doing real work”It is tempting to treat as bookkeeping — enforce it at the end and move on. It cannot be done that way, because there is no unconstrained optimum to enforce it on. From Equation 11.44a,
— a sum of positive terms, in every coordinate. Plain gradient ascent:
| step | ||
|---|---|---|
And afterwards, the constraint never needs enforcing again
Section titled “And afterwards, the constraint never needs enforcing again”Because with and :
| random responsibility matrices, | value |
|---|---|
| worst | |
| weights falling outside |
No clipping, no renormalisation, no projection. This is the same kind of structural guarantee page 1105 found for positive semi-definiteness — the update produces a valid object because of what it is, not because anything checks it afterwards.
One complete cycle
Section titled “One complete cycle”Applying all three updates in §11.3’s order, one at a time:
| after | negative log-likelihood | gained |
|---|---|---|
| the initialisation | ||
| means (§11.2.2) | ||
| variances (§11.2.3) | ||
| weights (§11.2.4) |
The only update that never sees the data
Section titled “The only update that never sees the data”and are averages of . is a count. Holding the responsibility matrix fixed and permuting the data values:
| data | |
|---|---|
| the original |
Identical, because Equation 11.42 reads only the column sums of . The data enters the weight update only through the responsibilities — which is exactly the structure §11.4.5 will formalise as the E-step supplying sufficient statistics to the M-step.
-
Why does Section 11.2.4 need a Lagrange multiplier when Sections 11.2.2 and 11.2.3 do not?
Measured: plain gradient ascent takes the weights from summing to 1 to summing to 2.54 in six steps and keeps climbing. The means and covariances have genuine interior optima; the weights only have one once the simplex constraint is imposed.
pch.quizShowAnswer
B — Because the log-likelihood's gradient in pi is strictly positive in every coordinate, so there is no unconstrained stationary point to find — Measured: plain gradient ascent takes the weights from summing to 1 to summing to 2.54 in six steps and keeps climbing. The means and covariances have genuine interior optima; the weights only have one once the simplex constraint is imposed.
-
What does the Lagrange multiplier come out to be?
Solved independently from each of the three components it gives minus 7.000000000000 every time, to a deviation of 0.0. Contrast Section 10.2's Lagrangian, where the multiplier was an eigenvalue and carried real information; here the constraint only rescales.
pch.quizShowAnswer
B — Exactly minus N — it is the normalising constant, because the N_k already sum to N — Solved independently from each of the three components it gives minus 7.000000000000 every time, to a deviation of 0.0. Contrast Section 10.2's Lagrangian, where the multiplier was an eigenvalue and carried real information; here the constraint only rescales.
-
After the update, how are the weights kept on the simplex?
Measured over 50,000 random responsibility matrices with K = 4: the weights sum to 1 to 2.2e-16 and not one falls outside [0, 1]. The same kind of structural guarantee page 1105 found for positive semi-definiteness.
pch.quizShowAnswer
B — Nothing is needed — N_k over N is automatically non-negative and sums to one, because the responsibilities' rows sum to one — Measured over 50,000 random responsibility matrices with K = 4: the weights sum to 1 to 2.2e-16 and not one falls outside [0, 1]. The same kind of structural guarantee page 1105 found for positive semi-definiteness.
-
What is structurally different about the weight update compared to the other two?
Permuting the data while holding the responsibilities fixed leaves the weights identical to six decimals. The means and covariances are averages of x; the weight is a count. Section 11.4.5 formalises this as the E-step passing sufficient statistics to the M-step.
pch.quizShowAnswer
B — It never looks at the data values — only at the column sums of the responsibility matrix — Permuting the data while holding the responsibilities fixed leaves the weights identical to six decimals. The means and covariances are averages of x; the weight is a count. Section 11.4.5 formalises this as the E-step passing sufficient statistics to the M-step.
Exercises
Section titled “Exercises”Exercise 1 – Reproduce Example 11.5, and solve for lambda
Section titled “Exercise 1 – Reproduce Example 11.5, and solve for lambda”Exercise 2 – Try it without the constraint
Section titled “Exercise 2 – Try it without the constraint”Exercise 3 – The simplex takes care of itself
Section titled “Exercise 3 – The simplex takes care of itself”Exercise 4 – The complete cycle, and the book’s two numbers
Section titled “Exercise 4 – The complete cycle, and the book’s two numbers”Exercise 5 – The weights never see the data
Section titled “Exercise 5 – The weights never see the data”Recall card
Section titled “Recall card”- Theorem 11.3: each weight becomes that component’s share of the data, its total responsibility divided by the number of points.
- This is the only update in the chapter that needs a Lagrange multiplier, because the weights must lie on a simplex and the other two parameters are unconstrained.
- The constraint is not bookkeeping. The log-likelihood’s gradient in the weights is strictly positive in every coordinate, so unconstrained ascent has nothing to converge to — measured, the weights’ sum reaches 2.54 in six steps and keeps climbing.
- The multiplier comes out as exactly minus N, solved independently from each component to a deviation of zero. It is the normalising constant, not new information.
- Contrast Section 10.2’s Lagrangian, where the multiplier was an eigenvalue and told you the variance retained.
- Afterwards the simplex looks after itself: over fifty thousand random responsibility matrices the weights sum to one to 2.2e-16 and never leave the unit interval.
- Example 11.5 reproduced: a third becomes 0.293890, 0.287001 and 0.419109, rounding to the book’s 0.29, 0.29 and 0.42.
- The complete cycle takes the negative log-likelihood from 28.325536 to 14.410485, which is the book’s 28.3 and 14.4.
- The means supply 12.32 of the 13.92 nats gained, the variances 1.46, the weights 0.14 — an ordering that reflects how badly each was initialised.
- But the weights can only ever reallocate mass between components that already exist, so with balanced clusters their update does almost nothing whatever the initialisation.
- And this is the only update that never reads the data values. Permuting the data with the responsibilities held fixed leaves the weights identical and moves every mean.
Next: The EM Algorithm — §11.3, which puts the three updates in a loop and states the guarantee that makes the loop worth running.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading