EM, Step by Step
Soft assignments, monotone likelihood, and convergence to the wrong local optimum.
Controls
Try K ≠ K* to see mixtures merge or split truth.
Distance between true centers, in standard deviations.
Ratio of the long axis to the short axis of each true cluster.
Every result on this page is a deterministic function of the seed and the controls.
Stage 0 of 17 — initialization.
Scatter: points coloured by soft responsibility
Colour is a weighted blend of the component colours by posterior responsibility; ellipses show 1 and 2 standard-deviation contours.
Log-likelihood versus EM iteration
Every completed E-step can only raise (or hold) the log-likelihood — the curve never dips.
Compare seeds: EM is not a global optimizer
Same data, same fitted K, same initialization strategy — different seeds land on different local optima.
| seed | final log-likelihood | iterations | global best? |
|---|---|---|---|
| 7 | -862.445 | 9 | yes |
| 8 | -862.445 | 7 | yes |
| 9 | -862.445 | 11 | yes |
| 10 | -862.445 | 7 | yes |
EM only guarantees that each iteration does not decrease the log-likelihood; it climbs the nearest hill from wherever it starts. Different seeds — hence different random initializations — regularly land at different final log-likelihoods for the identical dataset. The "worst-case corner" initialization above is built to strand components far from the data mass, and it converges to a clearly inferior optimum compared with a k-means++ start.
