Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Sorting a mixed bag
Imagine a bag of marbles from two factories. One factory makes small marbles and the other makes big ones, but nobody labelled them. To learn each factory’s typical size:
- Guess the two typical sizes.
- For each marble, decide how likely it is to be from each factory.
- Re-average the sizes using those likelihoods as weights.
- Repeat until nothing changes.
That loop is Expectation–Maximization. Each round fits the data at least as well as the last.
EM is how robots learn maps with uncertain data associations, how radar trackers separate clutter from targets, how speech and gesture recognizers train hidden Markov models, and how reliability engineers estimate failure rates when some parts haven’t failed yet.
- 1. EM is useful when the data have…
- 2. EM alternates between…
- 3. Each EM round makes the fit…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The two steps for a Gaussian mixture
Model: , with a hidden label for each point.
E-step (responsibilities):
M-step (weighted MLEs), with :
If the labels were known, the MLE would be a separate average per group. EM replaces each unknown label with its probability. With hard assignments (each 0 or 1) and equal fixed variances, EM becomes k-means.
- 1. A responsibility r_ik is…
- 2. In the M-step, the new mean μ_k is…
- 3. k-means is EM with…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.General EM
Observed data , hidden , parameters . Repeat:
- E-step: compute and form .
- M-step: .
EM is useful when the complete-data log-likelihood is easy to maximize (often closed form) but the marginal isn’t.
Practicalities
- Local optima. EM only climbs. Use several random restarts or k-means++ initialization, and keep the best log-likelihood.
- Degeneracy. A component can collapse onto one point (, likelihood → ∞). Add a variance floor or a prior, which turns EM into MAP-EM.
- Speed. Convergence is linear, with rate set by the fraction of missing information. Overlapping clusters converge slowly.
- Choosing K: BIC (A5.2-5) or cross-validated likelihood.
- Work in log space (log-sum-exp) for the E-step.
- 1. EM helps when this is easy to maximize:
- 2. To escape poor local optima, use…
- 3. A component shrinking onto a single point makes the likelihood…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.EM as coordinate ascent on the ELBO
For any (A5.2-9):
- E-step: maximize over . With fixed, the optimum is . The KL becomes 0 and the bound touches: .
- M-step: maximize over . doesn’t depend on , so this maximizes .
Monotonicity: . ∎ Under mild conditions, EM converges to a stationary point (Wu, 1983). When the exact posterior is intractable, restricting gives variational EM.
The censored-exponential example
Lifetimes , with some units still alive at time . By memorylessness, . The M-step is . Its fixed point solves (with censored units), so , the closed-form censored MLE.
Exercise 3.1: Show that the E-step makes the bound tight
With , , so . Directly: .
- 1. After the E-step, the ELBO equals…
- 2. EM's monotonicity follows from…
- 3. E[T | T > t] for Exp(λ) is…
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Rejecting spurious lidar returns
A lidar beam aimed at a wall returns mostly good ranges . Some returns are spurious (dust, multipath, rain), which we model as with probability . The beam-model mixture in Thrun, Burgard and Fox (2005) has exactly this form. EM estimates , and the responsibilities label each return as inlier or outlier. The plain mean is dragged far off; EM is not.
EM in AI, robotics and aerospace
- Hidden Markov models: Baum–Welch is EM with the forward–backward E-step. It’s used in speech, gesture and fault-mode recognition (Rabiner, 1989).
- Mapping and SLAM: EM over unknown data associations or correspondences (Thrun, Burgard and Fox, 2005). Point-cloud registration as EM over soft correspondences, as in Coherent Point Drift (Myronenko and Song, 2010).
- Target tracking: probabilistic multi-hypothesis tracking (PMHT) applies EM to measurement-to-target assignment (Streit and Luginbuhl, 1995).
- System identification: EM for linear state-space models with a Kalman-smoother E-step (Shumway and Stoffer, 1982), which learns process and measurement noise.
- Reliability: censored and interval-censored lifetime data from fleets and test campaigns.
References
- A. Dempster, N. Laird, D. Rubin (1977). “Maximum likelihood from incomplete data via the EM algorithm.” JRSS B, 39(1).
- C. F. J. Wu (1983). “On the convergence properties of the EM algorithm.” Annals of Statistics, 11(1).
- R. Neal, G. Hinton (1998). “A view of the EM algorithm that justifies incremental, sparse, and other variants.” In Learning in Graphical Models.
- G. McLachlan, T. Krishnan (2008). The EM Algorithm and Extensions, 2nd ed. Wiley.
- C. Do, S. Batzoglou (2008). “What is the expectation maximization algorithm?” Nature Biotechnology, 26(8).
- L. Rabiner (1989). “A tutorial on hidden Markov models and selected applications in speech recognition.” Proceedings of the IEEE, 77(2).
- S. Thrun, W. Burgard, D. Fox (2005). Probabilistic Robotics. MIT Press.
- A. Myronenko, X. Song (2010). “Point set registration: Coherent Point Drift.” IEEE TPAMI, 32(12).
- R. Shumway, D. Stoffer (1982). “An approach to time series smoothing and forecasting using the EM algorithm.” Journal of Time Series Analysis, 3(4).
- R. Streit, T. Luginbuhl (1995). “Probabilistic multi-hypothesis tracking.” NUWC-NPT Technical Report 10,428.