Updating the Means
With the responsibilities named, the first update falls out in half a page. §11.2.2 states it as a theorem and then spends the rest of the section on what it means — an importance-weighted average, an expectation, a picture of each data point tugging at each mean.
What you’ll learn
Section titled “What you’ll learn”- Theorem 11.1, Equation 11.20, and Example 11.3 reproduced: , , , which round to the book’s , and .
- Equation 11.23’s algebra: the stationarity condition is , checked to .
- Equations 11.25–11.26, which say the update is literally an expected value — is a probability vector over the data, verified to sum to exactly.
- Why the update can never run away: is a convex combination of the data, so one update lands every mean inside — the book’s goes from to — and where that stops being true, at , the component has died.
- An invariant the book does not state: exactly, for any responsibilities. Measured over arbitrary matrices, worst error .
- What one mean update alone buys: log-likelihood , a gain of nats without touching a variance or a weight.
- And the remark that follows the theorem: the same update with four different sets of variances gives four different answers.
Intuition: every mean is an average of the data, just not an equal one
Section titled “Intuition: every mean is an average of the data, just not an equal one”The sample mean is — every point weighted . Equation 11.20 is the same formula with the weights changed: point gets weight instead.
Everything else on this page follows from that single observation. The weights are non-negative and sum to one, so the answer is a convex combination: it lives inside the data, it cannot run off to infinity, and the arithmetic is a weighted average rather than anything more exotic. What makes the problem hard is not the formula — it is that the weights depend on the answer.
flowchart TD A["mu_k = (1/N_k) sum_n r_nk x_n
Equation 11.20"] A --> B["an importance-weighted
Monte Carlo estimate of the mean"] A --> C["E[X] under r_k = r_.k / N_k
Equations 11.25, 11.26"] A --> D["Figure 11.4: each point pulls
with strength r_nk"] B --> E["weights sum to 1 and are non-negative
-> mu_k lies inside the data"] C --> E D --> E
§11.2.2 Theorem 11.1
Section titled “§11.2.2 Theorem 11.1”Theorem 11.1 (Update of the GMM Means). The update of the mean parameters of the GMM is given by
The proof takes the derivative of Equation 11.21b through the chain rule, arrives at
and sets it to . Because is invertible it drops out entirely, leaving
Checked on the book’s initialisation:
with a largest gap of , and
| before | after | the book | ||
|---|---|---|---|---|
The same formula, said three ways
Section titled “The same formula, said three ways”As an expectation. Define (Equation 11.25). Then (Equation 11.26). Measured: each column of sums to exactly , every entry is non-negative, and under those weights reproduces Equation 11.20 to .
As importance weighting. “An importance-weighted Monte Carlo estimate of the mean, where the importance weights of data point are the responsibilities .”
As a picture. “The mean is pulled toward a data point with strength given by .”
An invariant the book does not state
Section titled “An invariant the book does not state”Swap the order of summation in :
So after any mean update, , whatever the responsibilities were:
| value | |
|---|---|
| the sample mean |
What one update alone is worth
Section titled “What one update alone is worth”Freezing the variances and weights at the book’s initialisation and iterating only Equation 11.20:
| round | log-likelihood | change | |
|---|---|---|---|
Most negative single step over twelve rounds: — the mean update alone never decreases the log-likelihood, which is the special case of §11.3’s guarantee. Note also where it stops: , well short of the full algorithm’s . The means alone cannot get there; the variances have to move too.
And the update still depends on everything
Section titled “And the update still depends on everything”The remark right after Theorem 11.1: “the update of the means […] depends on all means, covariance matrices , and mixture weights via . Therefore, we cannot obtain a closed-form solution for all at once.”
Same data, same starting means, same weights — only the variances differ:
| variances | |
|---|---|
| the book’s | |
| all | |
| all | |
| all |
The last row is the instructive one: with huge variances every component is nearly equally responsible for everything, so all three means collapse toward the sample mean . The variances decide how sharply the data is divided, and the means only then decide where the pieces sit.
-
In Equation 11.22c the inverse covariance appears. Why does it not appear in Equation 11.20?
The stationarity condition becomes the sum of r times x equalling N_k times mu, with the inverse covariance multiplying both sides. That is why the mean update is a plain weighted average and carries no covariance in it — checked to 1.8e-15.
pch.quizShowAnswer
B — Setting the gradient to zero lets an invertible matrix be cancelled from both sides — The stationarity condition becomes the sum of r times x equalling N_k times mu, with the inverse covariance multiplying both sides. That is why the mean update is a plain weighted average and carries no covariance in it — checked to 1.8e-15.
-
Why can a mean never leave the range of the data after one update?
Measured: the book's third mean starts at 8 with no data beyond 5 and lands at 3.704287 in one step, and over four thousand starting values in [-40, 55] there are zero excursions outside [-3, 5]. The proviso is that N_k must be positive: past 73.585070 every responsibility underflows to zero and the update becomes 0/0.
pch.quizShowAnswer
B — The weights r_nk / N_k are non-negative and sum to one, so the update is a convex combination of the data — Measured: the book's third mean starts at 8 with no data beyond 5 and lands at 3.704287 in one step, and over four thousand starting values in [-40, 55] there are zero excursions outside [-3, 5]. The proviso is that N_k must be positive: past 73.585070 every responsibility underflows to zero and the update becomes 0/0.
-
What is the N_k-weighted average of the updated means?
Swap the order of summation and the inner sum over k is one, leaving the sum of the data. Measured over 2,000 random Dirichlet matrices with no connection to the data, worst deviation 3.6e-15. So the mixture's overall mean is pinned to the data's after every M-step.
pch.quizShowAnswer
B — Exactly the sample mean, for any responsibility matrix whatsoever — Swap the order of summation and the inner sum over k is one, leaving the sum of the data. Measured over 2,000 random Dirichlet matrices with no connection to the data, worst deviation 3.6e-15. So the mixture's overall mean is pinned to the data's after every M-step.
-
Iterating only the mean update, with variances and weights frozen, does what?
Most negative single step over twelve rounds: exactly zero. The means alone cannot reach the full optimum because the variances are what decide how sharply the data is divided — and with the variances fixed, the responsibilities can only move so far.
pch.quizShowAnswer
B — Increases it monotonically — plus 12.321385 on the first step — but stops at minus 15.964728, short of the full algorithm's minus 13.973323 — Most negative single step over twelve rounds: exactly zero. The means alone cannot reach the full optimum because the variances are what decide how sharply the data is divided — and with the variances fixed, the responsibilities can only move so far.
Exercises
Section titled “Exercises”Exercise 1 – Reproduce Example 11.3
Section titled “Exercise 1 – Reproduce Example 11.3”Exercise 2 – A mean cannot leave the data
Section titled “Exercise 2 – A mean cannot leave the data”Exercise 3 – The update is an expectation
Section titled “Exercise 3 – The update is an expectation”Exercise 4 – The invariant, on responsibilities from nowhere
Section titled “Exercise 4 – The invariant, on responsibilities from nowhere”Exercise 5 – The same update, four different answers
Section titled “Exercise 5 – The same update, four different answers”Recall card
Section titled “Recall card”- Theorem 11.1: each mean becomes a responsibility-weighted average of the data, divided by that component’s total responsibility.
- The inverse covariance in the gradient cancels, because setting an expression times an invertible matrix to zero removes the matrix. That is why the update carries no covariance.
- Example 11.3 reproduced exactly: minus 4 to minus 2.701230, 0 to minus 0.403411, and 8 to 3.704287.
- The update is literally an expectation, Equation 11.26, under a probability vector over the data built by normalising a column of responsibilities.
- So every new mean is a convex combination of the data and cannot leave its range while its total responsibility is positive. Measured over four thousand starting values, zero excursions.
- Which makes it a sanity check: a mean outside the data means the responsibilities are wrong, not the update.
- Push a mean far enough away and its total responsibility underflows to exactly zero — at 73.585070 here — and the update becomes zero over zero. That is component death, and log-space arithmetic does not rescue it.
- An invariant the book does not state: the N_k-weighted sum of the new means is the sum of the data, exactly, for any responsibility matrix at all.
- Verified over two thousand random Dirichlet matrices, worst deviation 3.6e-15. It follows only from each row summing to one.
- So the mixture’s overall mean is pinned to the sample mean after every M-step, and only the distribution of mass among components can move.
- One mean update alone is worth 12.321385 nats on the book’s example, and iterating it never decreases the likelihood.
- But it stalls at minus 15.964728, short of the full algorithm’s minus 13.973323 — the variances have to move too.
- And the update depends on every other parameter: four sets of variances give four different answers from the same start, collapsing toward the sample mean when the variances are large.
Next: Updating the Covariances — §11.2.3, where the same argument runs again and the law of total variance from page 1101 comes back.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading