Skip to content
— CH. 1 · INTRODUCTION —

Expectation–maximization algorithm

~6 min read · Ch. 1 of 6
6 sections
  • The expectation-maximization algorithm sits at the heart of modern statistics, quietly solving problems that would otherwise be mathematically impossible. Statisticians call it EM for short, and its central trick is as elegant as it is counterintuitive: when you cannot solve two sets of equations at once, alternate between them until both converge. The algorithm handles situations where data is incomplete, observations are censored, or the model depends on variables that no one ever directly measured. What makes EM remarkable is not just that it works, but that it was being rediscovered again and again, in different fields, by researchers who had no idea others had arrived at the same idea. The question that runs through its history is how one method, rooted in a single deceptively simple alternation, came to touch fields as different as genetics, medical imaging, natural language processing, and financial risk management.

  • Arthur Dempster, Nan Laird, and Donald Rubin published the paper that named and formalized the EM algorithm in 1977, and they were candid about what they found when they looked back at the literature. The method had been proposed many times in special circumstances by earlier authors who did not recognize the general principle at work. Among the earliest was a gene-counting method for estimating allele frequencies, developed by Cedric Smith. H.O. Hartley had proposed a version in 1958, and a later paper by Hartley and Hocking in 1977 supplied many of the ideas that Dempster, Laird, and Rubin would build upon. S.K. Ng, Thriyambakam Krishnan, and G.J. McLachlan also published a version in 1977. Rolf Sundberg worked out an especially detailed treatment for exponential families in his thesis and in several papers, drawing on unpublished results from Per Martin-Löf and Anders Martin-Löf. The 1977 Dempster-Laird-Rubin paper generalized all of this and sketched a convergence argument for a wider class of problems, establishing EM as a standard tool of statistical analysis. That convergence argument, however, turned out to have a flaw. C.F. Jeff Wu published a correct convergence proof in 1983, extending the guarantee to models outside the exponential family, as Dempster, Laird, and Rubin had originally claimed.

  • To understand why EM exists, consider what statisticians face when a model involves variables that are never directly observed. These are called latent variables, and their presence creates a mathematical deadlock. Finding the maximum likelihood solution normally requires taking derivatives of a likelihood function and solving for all unknown quantities simultaneously. With latent variables in the picture, that simultaneous solution is usually impossible. The equations interlock: the right values for the parameters depend on knowing the latent variables, and the right values for the latent variables depend on knowing the parameters. Substituting one set of equations into the other produces an expression that cannot be solved analytically. A mixture model is one of the clearest illustrations of this problem. Each observed data point is assumed to come from one of several underlying distributions, but the assignment is unrecorded. The mixture component each point belongs to is the latent variable, and without knowing those assignments, estimating the distribution parameters is blocked. EM breaks the deadlock by starting with arbitrary parameter guesses and then alternating between two steps: computing the probability that each data point belongs to each component given current estimates, and then updating the parameter estimates given those probabilities, repeating until the values stabilize.

  • Each cycle of the EM algorithm consists of an E step and an M step, and the names describe exactly what each does. The expectation step constructs a function for the expected log-likelihood of the complete data, treating the latent variables as if they had been observed, weighted by their current probability estimates. The maximization step then finds the parameter values that make that expected log-likelihood as large as possible, and those new parameters feed into the next E step. Viewed from another angle, the E and M steps can each be interpreted as maximization operations over different parts of a single function, making EM a special case of coordinate descent. In information geometry, these same steps correspond to projections under dual affine connections known as the e-connection and the m-connection, and the Kullback-Leibler divergence that appears in those projections connects EM to a broader family of geometric ideas about probability distributions. When the model belongs to the exponential family, the E step reduces to computing expected sufficient statistics, and the M step reduces to maximizing a linear function. In that setting, Rolf Sundberg's formula, proved using unpublished results from Per Martin-Löf and Anders Martin-Löf, makes it possible to derive closed-form update equations for each step.

  • EM is guaranteed to increase the observed data likelihood at each iteration, but that guarantee stops short of promising the best possible answer. The algorithm converges to a local maximum, not necessarily the global one. For multimodal distributions, the final answer depends on where the algorithm started. Practitioners deal with this by running the algorithm from several different random starting points, a technique called random-restart hill climbing, and comparing where each run ends up. Simulated annealing methods offer another route out of local optima. In high dimensions the situation is more serious. The algorithm can converge arbitrarily slowly, and the number of local optima can grow exponentially. This has motivated a separate line of research into moment-based and spectral methods, which carry stronger theoretical guarantees including global convergence under certain conditions, with no spurious local optima. Gibbs' inequality is the key mathematical fact that makes EM's correctness provable at all: it ensures that improving the auxiliary Q function by choice of parameters cannot decrease the marginal likelihood of the observed data, so each M step is guaranteed to move in the right direction. One subtlety worth noting is that some likelihood functions contain singularities, spurious maxima where one component of a mixture is assigned zero variance and its mean is set equal to a single data point, giving a technically infinite density that is statistically meaningless.

  • Positron emission tomography, single-photon emission computed tomography, and x-ray computed tomography all rely on EM and its faster variants for reconstructing medical images. In quantitative genetics, EM is a standard method for estimating parameters in mixed models. Psychometricians use it to estimate item parameters and latent abilities in item response theory. Financial analysts have adopted it for pricing and risk management of portfolios, particularly because of its ability to handle missing data and unidentified variables. Natural language processing has two prominent EM-derived algorithms: the Baum-Welch algorithm for training hidden Markov models, and the inside-outside algorithm for unsupervised induction of probabilistic context-free grammars. The structural engineering community developed a variant called the Structural Identification using Expectation Maximization algorithm, or STRIDE, which uses sensor data to identify the natural vibration properties of structures without needing to know the input forces. Filtering and smoothing problems in control theory offer yet another application, where EM combines with Kalman filters and minimum-variance smoothers to simultaneously estimate both the state of a system and the parameters of the model governing that system. Yasuo Matsuyama extended the framework further with the alpha-EM algorithm, which generalizes the standard log-likelihood approach using alpha-log likelihood ratios and alpha-divergence, and which produces a faster version of the Hidden Markov model estimation algorithm known as alpha-HMM.

Common questions

Who invented the expectation-maximization algorithm?

Arthur Dempster, Nan Laird, and Donald Rubin named and formalized the EM algorithm in a 1977 paper, but they acknowledged that the method had been proposed many times before in special cases by earlier authors. Prior contributors include Cedric Smith, H.O. Hartley, and Rolf Sundberg, among others.

What is the expectation-maximization algorithm used for?

The EM algorithm is used to find maximum likelihood or maximum a posteriori estimates of parameters in statistical models that involve unobserved latent variables. Applications include medical image reconstruction, hidden Markov models, mixture model fitting, quantitative genetics, psychometrics, and financial risk management.

What are the E step and M step in the EM algorithm?

The E step computes the expected value of the log-likelihood function given current parameter estimates, treating unobserved latent variables probabilistically. The M step then finds the parameter values that maximize that expected log-likelihood, and the two steps alternate until the estimates converge.

Does the EM algorithm always find the global maximum?

No. The EM algorithm is only guaranteed to converge to a local maximum of the likelihood function, not the global maximum. The outcome depends on the starting values, and for multimodal distributions multiple local maxima may exist.

Who proved that the EM algorithm converges?

C.F. Jeff Wu published a correct convergence proof in 1983. The original 1977 Dempster-Laird-Rubin paper had included a flawed convergence argument; Wu's proof extended the guarantee to models outside the exponential family.

What is the alpha-EM algorithm?

The alpha-EM algorithm, developed by Yasuo Matsuyama, is a generalization of the standard EM algorithm that replaces the log-likelihood with an alpha-log likelihood ratio and uses alpha-divergence. It contains the standard log-EM algorithm as a special case and can converge faster by choosing an appropriate alpha value.

All sources

36 references cited across the entry

  1. 1journalThe EM algorithm – an old folk-song sung to a fast new tuneX.-L. Meng et al. — 1997
  2. 2journalMaximum Likelihood from Incomplete Data via the EM AlgorithmA.P. Dempster et al. — 1977
  3. 3journalThe estimation of gene frequencies in a random-mating populationR.M. Ceppelini — 1955
  4. 4journalMaximum Likelihood estimation from incomplete dataHerman Otto Hartley — 1958
  5. 5citationHandbook of Computational StatisticsShu Kay Ng et al. — Springer Berlin Heidelberg — 2011-12-21
  6. 6journalMaximum likelihood theory for incomplete data from an exponential familyRolf Sundberg — 1974
  7. 7journalAn iterative method for solution of the likelihood equations for incomplete data from exponential familiesRolf Sundberg — 1976
  8. 8journalThe notion of redundancy and its use as a quantitative measure of the discrepancy between a statistical hypothesis and a set of observational dataPer Martin-Löf — 1974
  9. 9journalOn the Convergence Properties of the EM AlgorithmC. F. Jeff Wu — Mar 1983
  10. 10bookStatistical Modelling by Exponential FamiliesRolf Sundberg — Cambridge University Press — 2019
  11. 11bookEncyclopedia of Statistical SciencesNan Laird — Wiley — 2006
  12. 12bookStatistical Analysis with Missing DataRoderick J.A. Little et al. — John Wiley & Sons — 1987
  13. 13bookLearning in Graphical ModelsRadford Neal et al. — MIT Press — 1999
  14. 14bookThe Elements of Statistical LearningTrevor Hastie et al. — Springer — 2001
  15. 15journalNewton—Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures DataMary J Lindstrom et al. — 1988
  16. 16journalFitting Mixed-Effects Models Using Efficient EM-Type AlgorithmsDavid A Van Dyk — 2000
  17. 17journalA new REML (parameter expanded) EM algorithm for linear mixed modelsS. M Diffey et al. — 2017
  18. 20journalRiccati Equation and EM Algorithm Convergence for Inertial Navigation AlignmentG. A. Einicke et al. — January 2009
  19. 21journalEM Algorithm State Matrix Estimation for NavigationG. A. Einicke et al. — May 2010
  20. 22journalIterative Smoother-Based Variance EstimationG. A. Einicke et al. — May 2012
  21. 23journalIterative Filtering and Smoothing of Measurements Possessing Poisson NoiseG. A. Einicke — Sep 2015
  22. 24journalAcceleration of the EM Algorithm by using Quasi-Newton MethodsMortaza Jamshidian et al. — 1997
  23. 25journalParameter expansion to accelerate EM: The PX-EM algorithmC Liu — 1998
  24. 26journalMaximum likelihood estimation via the ECM algorithm: A general frameworkXiao-Li Meng et al. — 1993
  25. 27journalThe ECME Algorithm: A Simple Extension of EM and ECM with Faster Monotone ConvergenceChuanhai Liu et al. — 1994
  26. 30journalThe α-EM algorithm: Surrogate likelihood maximization using α-logarithmic information measuresYasuo Matsuyama — 2003
  27. 31journalHidden Markov model estimation based on alpha-EM algorithm: Discrete and continuous alpha-HMMsYasuo Matsuyama — 2011
  28. 32journalMaximum likelihood estimation in a linear model from confined and censored normal dataM.S. Wolynetz — 1979
  29. 33journalContributions to the Mathematical Theory of EvolutionKarl Pearson — 1894
  30. 35bookLocal Loss Optimization in Operator Models: A New Insight into Spectral LearningBalle, Borja Quattoni, Ariadna Carreras, Xavier — 2012-06-27
  31. 36webThe MM AlgorithmKenneth Lange