A Gaussian Mixture Model (GMM) represents a distribution as a weighted sum of K Gaussian components: p(x) = Σ_k π_k N(x; μ_k, Σ_k).
Unlike k-means (the companion book), which makes hard cluster assignments, a GMM gives each point a soft, probabilistic assignment (responsibility) to each component.
Fitting a GMM by maximum likelihood is intractable in closed form because the log-likelihood contains a log of a sum: log Σ_k π_k N(x_i; μ_k, Σ_k). The Expectation-Maximization (EM) algorithm sidesteps this by alternating:
- E-step: compute the responsibility of component k for point x_i, given the current parameters:
γ_ik = π_k N(x_i; μ_k, Σ_k) / Σ_j π_j N(x_i; μ_j, Σ_j)
- M-step: update parameters using these responsibilities as soft weights:
μ_k = Σ_i γ_ik x_i / Σ_i γ_ik, Σ_k = Σ_i γ_ik (x_i-μ_k)(x_i-μ_k)^T / Σ_i γ_ik, π_k = (1/n)Σ_i γ_ik
Theorem 15.1 (Monotone likelihood increase). Each EM iteration does not decrease the observed-data log-likelihood.
Proof sketch. The E-step computes the exact posterior over the latent component assignments given the current parameters, which makes the Evidence Lower Bound (ELBO) — a function that always lower-bounds the true log-likelihood — touch the true log-likelihood exactly at the current parameters. The M-step then maximizes this ELBO over the parameters. Since the ELBO touches the log-likelihood at the start of the iteration and the M-step can only increase the ELBO, the log-likelihood at the new parameters must be at least as large as the ELBO's new value, which is at least as large as its value at the start — hence the true log-likelihood is non-decreasing. (This is the general EM argument; a full derivation requires Jensen's inequality to establish the ELBO bound, omitted here for space.) ∎ Like k-means (which EM for a GMM with tied spherical covariance and hard assignment reduces to almost exactly), EM converges only to a local optimum and is sensitive to initialization — k-means++ style initialization is a standard practical remedy.
Continue with the book
Explore the full treatment, worked examples, and exercises in The AI Algorithms Compendium.
Companion article for The AI Algorithms Compendium, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
