Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Several sources mixed together
A bin holds bolts from two factories. Factory A’s average 10 g and factory B’s average 14 g. Weigh many bolts and the histogram has two bumps. The weights follow a mixture distribution: first “which factory?”, then “how heavy?”.
Given one bolt weighing 13.8 g, which factory probably made it? That’s Bayes’ theorem again. Turning it around, if you only see the bolts, you can still work out the two factories’ shares and averages. That’s the job of the EM algorithm.
A lidar beam returns from the ground, from an obstacle, or from dust. A sensor is usually healthy but sometimes faulty. A lost robot might be in one of three similar corridors. Each is a mixture, and separating the components is how you detect obstacles, flag faults and localize.
- 1. Half the bolts average 10 g and half 14 g. The overall average?
- 2. Two well-separated bumps in a histogram suggest…
- 3. A 13.8 g bolt most likely came from…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Definition
A finite mixture with weights , , and component densities has density
Generative story: draw a latent label , then . This is ancestral sampling. A Gaussian mixture model (GMM) uses .
Moments (A4.1-8):
- ;
- .
Responsibilities (A4.1-3): .
- 1. Mixture 0.3·N(−1, 0.5²) + 0.7·N(2, 1²): mean?
- 2. Responsibilities are computed with…
- 3. A mixture's variance includes a between term that is…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Fitting mixtures: the EM algorithm
If you knew each point’s label, fitting would be easy: just compute per-component means and variances. You don’t, so alternate (Dempster, Laird and Rubin, 1977):
- E-step. Compute responsibilities under the current parameters.
- M-step. Re-estimate each component as a weighted MLE: , , .
The log-likelihood never decreases. EM converges to a local maximum, so use several random starts. Watch out for degenerate solutions where a component collapses onto one point (, likelihood ). A variance floor or a prior prevents this.
How many components?
More components always fit the training data better. BIC penalizes the parameters (1-D GMM) and usually picks a sensible . Alternatives are held-out likelihood and Dirichlet-process mixtures (A4.2-3).
Mixtures are everywhere
- Multimodality: a robot that can’t tell which of three identical corridors it’s in has a three-bump belief. A single Gaussian can’t represent it, but a mixture (or a particle filter) can.
- Outlier models: is the standard “inlier + outlier” sensor model.
- Continuous mixtures: a normal whose variance is drawn from an inverse-gamma is a Student-t (Practice Code 5). A Poisson whose rate is gamma-distributed is a negative binomial (A4.2-5).
- 1. EM's E-step computes…
- 2. Can EM's log-likelihood decrease between iterations?
- 3. A 1-D GMM with K = 3 has how many free parameters?
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why EM never goes down
For any distribution over the latent labels, Jensen’s inequality gives a lower bound:
The gap is .
- E-step. Setting makes the bound tight.
- M-step. Maximizing over can only raise it.
- Result. . ∎
The same evidence lower bound (ELBO) is what variational autoencoders maximize (Kingma and Welling, 2014).
Identifiability and label switching
Permuting the component labels gives the same mixture, so there are equivalent parameter settings. Compare fitted components only after sorting them, for example by mean. Bayesian MCMC for mixtures must handle this explicitly.
Student-t as a Gaussian scale mixture
If and , then . Integrating out gives . This is why t-based robust estimators can be fitted with EM. The E-step’s expected precision is exactly the IRLS weight from A4.2-2.
Exercise 3.1: Prove the mixture-variance formula
Apply the law of total variance with : and .
- 1. EM's monotonicity comes from…
- 2. How many label permutations does a K = 3 mixture have?
- 3. The t-distribution's E-step weight is…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Fitting a lidar range mixture with EM
Ranges measured along one lidar beam over time mix returns from the ground, from a nearby pole, and spurious near-field returns (dust, rain). That’s a 3-component mixture. EM recovers each component’s weight, location and spread from unlabelled ranges, and BIC confirms three components. Thrun, Burgard and Fox (2005) build the standard beam sensor model from mixtures like this: hit, short return, max range and random. Background subtraction in vision fits a per-pixel GMM (Stauffer and Grimson, 1999), and anomaly detection flags points with low mixture likelihood.
Mixtures in AI, robotics and aerospace
- Multi-hypothesis estimation. Gaussian-sum filters and multiple-model trackers (IMM; Blom and Bar-Shalom, 1988) represent beliefs as Gaussian mixtures. They’re used for manoeuvring targets and for spacecraft whose thruster mode is unknown.
- Mixture density networks output mixture parameters, so a network can predict several plausible outcomes. Examples are where a pedestrian might go, or which grasp might work (Bishop, 1994; Ha and Schmidhuber, 2018).
- Mixture-of-experts layers route each input to a few specialist subnetworks with learned gating weights, which scales large models efficiently (Jacobs et al., 1991; Shazeer et al., 2017).
- Behaviour cloning with multimodal actions. Averaging two valid demonstrations, like going left or right around an obstacle, gives a collision. Mixture or diffusion policies keep the modes separate (Chi et al., 2023).
References
- A. Dempster, N. Laird, D. Rubin (1977). “Maximum likelihood from incomplete data via the EM algorithm.” JRSS B, 39(1).
- G. McLachlan, D. Peel (2000). Finite Mixture Models. Wiley.
- G. Schwarz (1978). “Estimating the dimension of a model.” Annals of Statistics, 6(2). (BIC.)
- S. Thrun, W. Burgard, D. Fox (2005). Probabilistic Robotics, Ch. 6. MIT Press.
- C. Stauffer, W. E. L. Grimson (1999). “Adaptive background mixture models for real-time tracking.” CVPR.
- H. Blom, Y. Bar-Shalom (1988). “The interacting multiple model algorithm for systems with Markovian switching coefficients.” IEEE Transactions on Automatic Control, 33(8).
- C. Bishop (1994). Mixture Density Networks. Aston University Technical Report NCRG/94/004.
- R. Jacobs, M. Jordan, S. Nowlan, G. Hinton (1991). “Adaptive mixtures of local experts.” Neural Computation, 3(1).
- N. Shazeer et al. (2017). “Outrageously large neural networks: the sparsely-gated mixture-of-experts layer.” ICLR.
- C. Chi et al. (2023). “Diffusion policy: visuomotor policy learning via action diffusion.” RSS.