Description
The symbols
Given the statistical model which generates a set \mathbf{X} of observed data, a set of unobserved latent data or missing values \mathbf{Z}, and a vector of unknown parameters \boldsymbol\theta, along with a likelihood function L(\boldsymbol\theta; \mathbf{X}, \mathbf{Z}) = p(\mathbf{X}, \mathbf{Z}\mid\boldsymbol\theta), the maximum likelihood estimate (MLE) of the unknown parameters is determined by maximizing the marginal likelihood of the observed data
:L(\boldsymbol\theta; \mathbf{X}) = p(\mathbf{X}\mid\boldsymbol\theta) = \int p(\mathbf{X},\mathbf{Z} \mid \boldsymbol\theta) , d\mathbf{Z} = \int p(\mathbf{X} \mid \mathbf{Z}, \boldsymbol\theta) p(\mathbf{Z} \mid \boldsymbol\theta) , d\mathbf{Z}
However, this quantity is often intractable since \mathbf{Z} is unobserved and the distribution of \mathbf{Z} is unknown before attaining \boldsymbol\theta.
The EM algorithm
The EM algorithm seeks to find the maximum likelihood estimate of the marginal likelihood by iteratively applying these two steps:
:Expectation step (E step): Define Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) as the expected value of the log likelihood function of \boldsymbol\theta, with respect to the current conditional distribution of \mathbf{Z} given \mathbf{X} and the current estimates of the parameters \boldsymbol\theta^{(t)}:
:= \int \log p (\mathbf X, \mathbf Z | \boldsymbol \theta) \, p (\mathbf Z | \mathbf X , \boldsymbol \theta^{(t)}) \, d \mathbf Z
\,
:*Maximization step (M step)*: Find the parameters that maximize this quantity:
::\boldsymbol\theta^{(t+1)} = \underset{\boldsymbol\theta}{\operatorname{arg\,max}} \ Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) \,
More succinctly, we can write it as one equation:\boldsymbol\theta^{(t+1)} = \underset{\boldsymbol\theta}{\operatorname{arg\,max}}
\operatorname{E}_{\mathbf{Z} \sim p(\cdot | \mathbf{X},\boldsymbol\theta^{(t)})}\left[ \log p (\mathbf{X},\mathbf{Z} | \boldsymbol\theta) \right] \,
### Interpretation of the variables
The typical models to which EM is applied use \mathbf{Z} as a latent variable indicating membership in one of a set of groups:
1. The observed data points \mathbf{X} may be discrete (taking values in a finite or countably infinite set) or continuous (taking values in an uncountably infinite set). Associated with each data point may be a vector of observations.
1. The missing values (aka latent variables) \mathbf{Z} are discrete, drawn from a fixed number of values, and with one latent variable per observed unit.
1. The parameters are continuous, and are of two kinds: Parameters that are associated with all data points, and those associated with a specific value of a latent variable (i.e., associated with all data points whose corresponding latent variable has that value).
However, it is possible to apply EM to other sorts of models.
The motivation is as follows. If the value of the parameters \boldsymbol\theta is known, usually the value of the latent variables \mathbf{Z} can be found by maximizing the log-likelihood over all possible values of \mathbf{Z}, either simply by iterating over \mathbf{Z} or through an algorithm such as the Viterbi algorithm for hidden Markov models. Conversely, if we know the value of the latent variables \mathbf{Z}, we can find an estimate of the parameters \boldsymbol\theta fairly easily, typically by simply grouping the observed data points according to the value of the associated latent variable and averaging the values, or some function of the values, of the points in each group. This suggests an iterative algorithm, in the case where both \boldsymbol\theta and \mathbf{Z} are unknown:
1. First, initialize the parameters \boldsymbol\theta to some random values.
1. Compute the probability of each possible value of \mathbf{Z} , given \boldsymbol\theta.
1. Then, use the just-computed values of \mathbf{Z} to compute a better estimate for the parameters \boldsymbol\theta.
1. Iterate steps 2 and 3 until convergence.
The algorithm as just described monotonically approaches a local minimum of the cost function.
## Properties
Although an EM iteration does increase the observed data (i.e., marginal) likelihood function, no guarantee exists that the sequence converges to a maximum likelihood estimator. For multimodal distributions, this means that an EM algorithm may converge to a local maximum of the observed data likelihood function, depending on starting values. A variety of heuristic or metaheuristic approaches exist to escape a local maximum, such as random-restart hill climbing (starting with several different random initial estimates \boldsymbol\theta^{(t)}), or applying simulated annealing methods.
EM is especially useful when the likelihood is an exponential family, see Sundberg (2019, Ch. 8) for a comprehensive treatment: the E step becomes the sum of expectations of sufficient statistics, and the M step involves maximizing a linear function. In such a case, it is usually possible to derive closed-form expression updates for each step, using the Sundberg formula (proved and published by Rolf Sundberg, based on unpublished results of Per Martin-Löf and Anders Martin-Löf).
The EM method was modified to compute maximum a posteriori (MAP) estimates for Bayesian inference in the original paper by Dempster, Laird, and Rubin.
Other methods exist to find maximum likelihood estimates, such as gradient descent, conjugate gradient, or variants of the Gauss–Newton algorithm. Unlike EM, such methods typically require the evaluation of first and/or second derivatives of the likelihood function.
## Proof of correctness
Expectation-Maximization works to improve Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) rather than directly improving \log p(\mathbf{X}\mid\boldsymbol\theta). Here it is shown that improvements to the former imply improvements to the latter.
For any \mathbf{Z} with non-zero probability p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta), we can write
:
\log p(\mathbf{X}\mid\boldsymbol\theta) = \log p(\mathbf{X},\mathbf{Z}\mid\boldsymbol\theta) - \log p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta).
We take the expectation over possible values of the unknown data \mathbf{Z} under the current parameter estimate \theta^{(t)} by multiplying both sides by p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta^{(t)}) and summing (or integrating) over \mathbf{Z}. The left-hand side is the expectation of a constant, so we get:
:
\begin{align}
\log p(\mathbf{X}\mid\boldsymbol\theta) &
= \sum_{\mathbf{Z}} p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta^{(t)}) \log p(\mathbf{X},\mathbf{Z}\mid\boldsymbol\theta)
- \sum_{\mathbf{Z}} p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta^{(t)}) \log p(\mathbf{Z}\mid\mathbf{X},\boldsymbol\theta) \\
& = Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) + H(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}),
\end{align}
where H(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) is defined by the negated sum it is replacing.
This last equation holds for every value of \boldsymbol\theta including \boldsymbol\theta = \boldsymbol\theta^{(t)},
:
\log p(\mathbf{X}\mid\boldsymbol\theta^{(t)})
= Q(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)}) + H(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)}),
and subtracting this last equation from the previous equation gives
:
\log p(\mathbf{X}\mid\boldsymbol\theta) - \log p(\mathbf{X}\mid\boldsymbol\theta^{(t)})
= Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) - Q(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)})
+ H(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) - H(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)}).
However, Gibbs' inequality tells us that H(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) \ge H(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)}), so we can conclude that
:
\log p(\mathbf{X}\mid\boldsymbol\theta) - \log p(\mathbf{X}\mid\boldsymbol\theta^{(t)})
\ge Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) - Q(\boldsymbol\theta^{(t)}\mid\boldsymbol\theta^{(t)}).
In words, choosing \boldsymbol\theta to improve Q(\boldsymbol\theta\mid\boldsymbol\theta^{(t)}) causes \log p(\mathbf{X}\mid\boldsymbol\theta) to improve at least as much.
## As a maximization–maximization procedure
The EM algorithm can be viewed as two alternating maximization steps, that is, as an example of coordinate descent. Consider the function:
: F(q,\theta) := \operatorname{E}_q [ \log L (\theta ; x,Z) ] + H(q),
where *q* is an arbitrary probability distribution over the unobserved data *z* and *H(q)* is the entropy of the distribution *q*. This function can be written as
: F(q,\theta) = -D_{\mathrm{KL}}\big(q \parallel p_{Z\mid X}(\cdot\mid x;\theta ) \big) + \log L(\theta;x),
where p_{Z\mid X}(\cdot\mid x;\theta ) is the conditional distribution of the unobserved data given the observed data x and D_{KL} is the Kullback–Leibler divergence.
Then the steps in the EM algorithm may be viewed as:
:*Expectation step*: Choose q to maximize F:
:: q^{(t)} = \operatorname{arg\,max}_q \ F(q,\theta^{(t)})
:*Maximization step*: Choose \theta to maximize F:
:: \theta^{(t+1)} = \operatorname{arg\,max}_\theta \ F(q^{(t)},\theta)
## Applications
- EM is frequently used for parameter estimation of mixed models, notably in quantitative genetics.
- In psychometrics, EM is an important tool for estimating item parameters and latent abilities of item response theory models.
- With the ability to deal with missing data and observe unidentified variables, EM is becoming a useful tool to price and manage risk of a portfolio.
- The EM algorithm (and its faster variant ordered subset expectation maximization) is also widely used in medical image reconstruction, especially in positron emission tomography, single-photon emission computed tomography, and x-ray computed tomography. See below for other faster variants of EM.
- In structural engineering, the Structural Identification using Expectation Maximization (STRIDE) algorithm is an output-only method for identifying natural vibration properties of a structural system using sensor data (see Operational Modal Analysis).
- EM is also used for data clustering. In natural language processing, two prominent instances of the algorithm are the Baum–Welch algorithm for hidden Markov models, and the inside-outside algorithm for unsupervised induction of probabilistic context-free grammars.
- In the analysis of intertrade waiting times the EM algorithm has proved to be very useful.
## Filtering and smoothing EM algorithms
A Kalman filter is typically used for on-line state estimation and a minimum-variance smoother may be employed for off-line or batch state estimation. However, these minimum-variance solutions require estimates of the state-space model parameters. EM algorithms can be used for solving joint state and parameter estimation problems.
Filtering and smoothing EM algorithms arise by repeating this two-step procedure:
;E-step
: Operate a Kalman filter or a minimum-variance smoother designed with current parameter estimates to obtain updated state estimates.
;M-step
: Use the filtered or smoothed state estimates within maximum-likelihood calculations to obtain updated parameter estimates.
Suppose that a Kalman filter or minimum-variance smoother operates on measurements of a single-input-single-output system that possess additive white noise. An updated measurement noise variance estimate can be obtained from the maximum likelihood calculation
: \widehat{\sigma}^2_v = \frac{1}{N} \sum_{k=1}^N {(z_k-\widehat{x}_k)}^2,
where \widehat{x}_k are scalar output estimates calculated by a filter or a smoother from N scalar measurements z_k. The above update can also be applied to updating a Poisson measurement noise intensity. Similarly, for a first-order auto-regressive process, an updated process noise variance estimate can be calculated by
: \widehat{\sigma}^2_w = \frac{1}{N} \sum_{k=1}^N {(\widehat{x}_{k+1}-\widehat{F}\widehat_k)}^2,
where \widehat{x}_k and \widehat{x}_{k+1} are scalar state estimates calculated by a filter or a smoother. The updated model coefficient estimate is obtained via
: \widehat{F} = \frac{\sum_{k=1}^N {(\widehat{x}_{k+1}-\widehat{F} \widehat{x}_k)}^2}{\sum_{k=1}^N \widehat{x}_k^2}.
The convergence of parameter estimates such as those above are well studied.{{Cite journal
## Variants
A number of methods have been proposed to accelerate the sometimes slow convergence of the EM algorithm, such as those using conjugate gradient and modified Newton's methods (Newton–Raphson). Also, EM can be used with constrained estimation methods.
*Parameter-expanded expectation maximization (PX-EM)* algorithm often provides speed up by "us[ing] a `covariance adjustment' to correct the analysis of the M step, capitalising on extra information captured in the imputed complete data".
*Expectation conditional maximization (ECM)* replaces each M step with a sequence of conditional maximization (CM) steps in which each parameter *θ**i* is maximized individually, conditionally on the other parameters remaining fixed. Itself can be extended into the *Expectation conditional maximization either (ECME)* algorithm.
This idea is further extended in *generalized expectation maximization (GEM)* algorithm, in which is sought only an increase in the objective function *F* for both the E step and M step as described in the As a maximization–maximization procedure section. GEM is further developed in a distributed environment and shows promising results.
It is also possible to consider the EM algorithm as a subclass of the **MM** (Majorize/Minimize or Minorize/Maximize, depending on context) algorithm, and therefore use any machinery developed in the more general case.
### α-EM algorithm
The Q-function used in the EM algorithm is based on the log likelihood. Therefore, it is regarded as the log-EM algorithm. The use of the log likelihood can be generalized to that of the α-log likelihood ratio. Then, the α-log likelihood ratio of the observed data can be exactly expressed as equality by using the Q-function of the α-log likelihood ratio and the α-divergence. Obtaining this Q-function is a generalized E step. Its maximization is a generalized M step. This pair is called the α-EM algorithm
which contains the log-EM algorithm as its subclass. Thus, the α-EM algorithm by Yasuo Matsuyama is an exact generalization of the log-EM algorithm. No computation of gradient or Hessian matrix is needed. The α-EM shows faster convergence than the log-EM algorithm by choosing an appropriate α. The α-EM algorithm leads to a faster version of the Hidden Markov model estimation algorithm α-HMM.
## Relation to variational Bayes methods
EM is a partially non-Bayesian, maximum likelihood method. Its final result gives a probability distribution over the latent variables (in the Bayesian style) together with a point estimate for *θ* (either a maximum likelihood estimate or a posterior mode). A fully Bayesian version of this may be wanted, giving a probability distribution over *θ* and the latent variables. The Bayesian approach to inference is simply to treat *θ* as another latent variable. In this paradigm, the distinction between the E and M steps disappears. If using the factorized Q approximation as described above (variational Bayes), solving can iterate over each latent variable (now including *θ*) and optimize them one at a time. Now, *k* steps per iteration are needed, where *k* is the number of latent variables. For graphical models this is easy to do as each variable's new *Q* depends only on its Markov blanket, so local message passing can be used for efficient inference.
## Geometric interpretation
In information geometry, the E step and the M step are interpreted as projections under dual affine connections, called the e-connection and the m-connection; the Kullback–Leibler divergence can also be understood in these terms.
## Examples
### Gaussian mixture === <!--This section is linked from [[Matrix calculus]] -->
::figure[src="https://upload.wikimedia.org/wikipedia/commons/0/09/ClusterAnalysis_Mouse.svg" caption="Voronoi]]-cells. The cluster center is indicated by the lighter, bigger symbol."]
::
::figure[src="https://upload.wikimedia.org/wikipedia/commons/a/a7/Em_old_faithful.gif" caption="An animation demonstrating the EM algorithm fitting a two component Gaussian [[mixture model]] to the [[Old Faithful]] dataset. The algorithm steps through from a random initialization to convergence."]
::
Let \mathbf{x} = (\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_n) be a sample of n independent observations from a mixture of two multivariate normal distributions of dimension d, and let \mathbf{z} = (z_1,z_2,\ldots,z_n) be the latent variables that determine the component from which the observation originates.
: X_i \mid(Z_i = 1) \sim \mathcal{N}_d(\boldsymbol{\mu}_1,\Sigma_1) and X_i \mid(Z_i = 2) \sim \mathcal{N}_d(\boldsymbol{\mu}_2,\Sigma_2),
where
: \operatorname{P} (Z_i = 1 ) = \tau_1 \, and \operatorname{P} (Z_i=2) = \tau_2 = 1-\tau_1.
The aim is to estimate the unknown parameters representing the *mixing* value between the Gaussians and the means and covariances of each:
: \theta = \big( \boldsymbol{\tau},\boldsymbol{\mu}_1,\boldsymbol{\mu}_2,\Sigma_1,\Sigma_2 \big),
where the incomplete-data likelihood function is
: L(\theta;\mathbf{x}) = \prod_{i=1}^n \sum_{j=1}^2 \tau_j \ f(\mathbf{x}_i;\boldsymbol{\mu}_j,\Sigma_j),
and the complete-data likelihood function is
: L(\theta;\mathbf{x},\mathbf{z}) = p(\mathbf{x},\mathbf{z} \mid \theta) = \prod_{i=1}^n \prod_{j=1}^2 \ [f(\mathbf{x}_i;\boldsymbol{\mu}_j,\Sigma_j) \tau_j] ^{\mathbb{I}(z_i=j)},
or
: L(\theta;\mathbf{x},\mathbf{z}) = \exp \left\{ \sum_{i=1}^n \sum_{j=1}^2 \mathbb{I}(z_i=j) \big[ \log \tau_j -\tfrac{1}{2} \log |\Sigma_j| -\tfrac{1}{2}(\mathbf{x}_i-\boldsymbol{\mu}_j)^\top\Sigma_j^{-1} (\mathbf{x}_i-\boldsymbol{\mu}_j) -\tfrac{d}{2} \log(2\pi) \big] \right\},
where \mathbb{I} is an indicator function and f is the probability density function of a multivariate normal.
In the last equality, for each *i*, one indicator \mathbb{I}(z_i=j) is equal to zero, and one indicator is equal to one. The inner sum thus reduces to one term.
#### E step
Given our current estimate of the parameters *θ*(*t*), the conditional distribution of the *Z**i* is determined by Bayes' theorem to be the proportional height of the normal density weighted by *τ*:
: T_{j,i}^{(t)} := \operatorname{P}(Z_i=j \mid X_i=\mathbf{x}_i ;\theta^{(t)}) = \frac{\tau_j^{(t)} \ f(\mathbf{x}_i;\boldsymbol{\mu}_j^{(t)},\Sigma_j^{(t)})}{\tau_1^{(t)} \ f(\mathbf{x}_i;\boldsymbol{\mu}_1^{(t)},\Sigma_1^{(t)}) + \tau_2^{(t)} \ f(\mathbf{x}_i;\boldsymbol{\mu}_2^{(t)},\Sigma_2^{(t)})}.
These are called the "membership probabilities", which are normally considered the output of the E step (although this is not the Q function of below).
This E step corresponds with setting up this function for Q:
: \begin{align}Q(\theta\mid\theta^{(t)})
&= \operatorname{E}_{\mathbf{Z}\mid\mathbf{X}=\mathbf{x};\mathbf{\theta}^{(t)}} [\log L(\theta;\mathbf{x},\mathbf{Z}) ] \\
&= \operatorname{E}_{\mathbf{Z}\mid\mathbf{X}=\mathbf{x};\mathbf{\theta}^{(t)}} [\log \prod_{i=1}^{n}L(\theta;\mathbf{x}_i,Z_i) ] \\
&= \operatorname{E}_{\mathbf{Z}\mid\mathbf{X}=\mathbf{x};\mathbf{\theta}^{(t)}} [\sum_{i=1}^n \log L(\theta;\mathbf{x}_i,Z_i) ] \\
&= \sum_{i=1}^n\operatorname{E}_{Z_i\mid X_i=x_i;\mathbf{\theta}^{(t)}} [\log L(\theta;\mathbf{x}_i,Z_i) ] \\
&= \sum_{i=1}^n \sum_{j=1}^2 P(Z_i =j \mid X_i = \mathbf{x}_i; \theta^{(t)}) \log L(\theta_j;\mathbf{x}_i,j) \\
&= \sum_{i=1}^n \sum_{j=1}^2 T_{j,i}^{(t)} \big[ \log \tau_j -\tfrac{1}{2} \log |\Sigma_j| -\tfrac{1}{2}(\mathbf{x}_i-\boldsymbol{\mu}_j)^\top\Sigma_j^{-1} (\mathbf{x}_i-\boldsymbol{\mu}_j) -\tfrac{d}{2} \log(2\pi) \big].
\end{align}
The expectation of \log L(\theta;\mathbf{x}_i,Z_i) inside the sum is taken with respect to the probability density function P(Z_i \mid X_i = \mathbf{x}_i; \theta^{(t)}), which might be different for each \mathbf{x}_i of the training set. Everything in the E step is known before the step is taken except T_{j,i}, which is computed according to the equation at the beginning of the E step section.
This full conditional expectation does not need to be calculated in one step, because *τ* and **μ**/**Σ** appear in separate linear terms and can thus be maximized independently.
#### M step
Q(\theta \mid \theta^{(t)} ) being quadratic in form means that determining the maximizing values of \theta is relatively straightforward. Also, \tau, (\boldsymbol{\mu}_1,\Sigma_1) and (\boldsymbol{\mu}_2,\Sigma_2) may all be maximized independently since they all appear in separate linear terms.
To begin, consider \tau, which has the constraint \tau_1+\tau_2=1:
: \begin{align}\boldsymbol{\tau}^{(t+1)}
&= \underset{\boldsymbol{\tau}} {\operatorname{arg\,max}}\ Q(\theta \mid \theta^{(t)} ) \\
&= \underset{\boldsymbol{\tau}} {\operatorname{arg\,max}} \ \left\{ \left[ \sum_{i=1}^n T_{1,i}^{(t)} \right] \log \tau_1 + \left[ \sum_{i=1}^n T_{2,i}^{(t)} \right] \log \tau_2 \right\}.
\end{align}
This has the same form as the maximum likelihood estimate for the binomial distribution, so
: \tau^{(t+1)}_j = \frac{\sum_{i=1}^n T_{j,i}^{(t)}}{\sum_{i=1}^n (T_{1,i}^{(t)} + T_{2,i}^{(t)} ) } = \frac{1}{n} \sum_{i=1}^n T_{j,i}^{(t)}.
For the next estimates of (\boldsymbol{\mu}_1,\Sigma_1):
: \begin{align}(\boldsymbol{\mu}_1^{(t+1)},\Sigma_1^{(t+1)})
&= \underset{\boldsymbol{\mu}_1,\Sigma_1} \operatorname{arg\,max}\ Q(\theta \mid \theta^{(t)} ) \\
&= \underset{\boldsymbol{\mu}_1,\Sigma_1} \operatorname{arg\,max}\ \sum_{i=1}^n T_{1,i}^{(t)} \left\{ -\tfrac{1}{2} \log |\Sigma_1| -\tfrac{1}{2}(\mathbf{x}_i-\boldsymbol{\mu}_1)^\top\Sigma_1^{-1} (\mathbf{x}_i-\boldsymbol{\mu}_1) \right\}
\end{align}.
This has the same form as a weighted maximum likelihood estimate for a normal distribution, so
: \boldsymbol{\mu}_1^{(t+1)} = \frac{\sum_{i=1}^n T_{1,i}^{(t)} \mathbf{x}_i}{\sum_{i=1}^n T_{1,i}^{(t)}} and \Sigma_1^{(t+1)} = \frac{\sum_{i=1}^n T_{1,i}^{(t)} (\mathbf{x}_i - \boldsymbol{\mu}_1^{(t+1)}) (\mathbf{x}_i - \boldsymbol{\mu}_1^{(t+1)})^\top }{\sum_{i=1}^n T_{1,i}^{(t)}}
and, by symmetry,
: \boldsymbol{\mu}_2^{(t+1)} = \frac{\sum_{i=1}^n T_{2,i}^{(t)} \mathbf{x}_i}{\sum_{i=1}^n T_{2,i}^{(t)}} and \Sigma_2^{(t+1)} = \frac{\sum_{i=1}^n T_{2,i}^{(t)} (\mathbf{x}_i - \boldsymbol{\mu}_2^{(t+1)}) (\mathbf{x}_i - \boldsymbol{\mu}_2^{(t+1)})^\top }{\sum_{i=1}^n T_{2,i}^{(t)}}.
#### Termination
Conclude the iterative process if E_{Z\mid\theta^{(t)},\mathbf{x}}[\log L(\theta^{(t)};\mathbf{x},\mathbf{Z})] \leq E_{Z\mid\theta^{(t-1)},\mathbf{x}}[\log L(\theta^{(t-1)};\mathbf{x},\mathbf{Z})] + \varepsilon for \varepsilon below some preset threshold.
#### Generalization
The algorithm illustrated above can be generalized for mixtures of more than two multivariate normal distributions.
### Truncated and censored regression
The EM algorithm has been implemented in the case where an underlying linear regression model exists explaining the variation of some quantity, but where the values actually observed are censored or truncated versions of those represented in the model. Special cases of this model include censored or truncated observations from one normal distribution.
## Alternatives
EM typically converges to a local optimum, not necessarily the global optimum, with no bound on the convergence rate in general. It is possible that it can be arbitrarily poor in high dimensions and there can be an exponential number of local optima. Hence, a need exists for alternative methods for guaranteed learning, especially in the high-dimensional setting. Alternatives to EM exist with better guarantees for consistency, which are termed *moment-based approaches* or the so-called *spectral techniques*. Moment-based approaches to learning the parameters of a probabilistic model enjoy guarantees such as global convergence under certain conditions unlike EM which is often plagued by the issue of getting stuck in local optima. Algorithms with guarantees for learning can be derived for a number of important models such as mixture models, HMMs etc. For these spectral methods, no spurious local optima occur, and the true parameters can be consistently estimated under some regularity conditions.
## References
## References
1. (1997). "The EM algorithm – an old folk-song sung to a fast new tune". *J. Royal Statist. Soc. B*.
2. (1955). "The estimation of gene frequencies in a random-mating population". *Ann. Hum. Genet.*.
3. Hartley, Herman Otto. (1958). "Maximum Likelihood estimation from incomplete data". *Biometrics*.
4. (2011-12-21). "The EM Algorithm". *Springer Berlin Heidelberg*.
5. See the acknowledgement by Dempster, Laird and Rubin on pages 3, 5 and 11.
6. [[Per Martin-Löf]]. 1966. ''Statistics from the point of view of statistical mechanics''. Lecture notes, Mathematical Institute, Aarhus University. ("Sundberg formula", credited to Anders Martin-Löf).
7. [[Per Martin-Löf]]. 1970. ''Statistiska Modeller (Statistical Models): Anteckningar från seminarier läsåret 1969–1970 (Lecture notes 1969-1970), with the assistance of Rolf Sundberg.'' Stockholm University.
8. Martin-Löf, P. The notion of redundancy and its use as a quantitative measure of the deviation between a statistical hypothesis and a set of observational data. With a discussion by F. Abildgård, [[Arthur P. Dempster. A. P. Dempster]], [[D. Basu]], [[D. R. Cox]], [[A. W. F. Edwards]], D. A. Sprott, [[George A. Barnard. G. A. Barnard]], O. Barndorff-Nielsen, J. D. Kalbfleisch and [[Rasch model. G. Rasch]] and a reply by the author. ''Proceedings of Conference on Foundational Questions in Statistical Inference'' (Aarhus, 1973), pp. 1–42. Memoirs, No. 1, Dept. Theoret. Statist., Inst. Math., Univ. Aarhus, Aarhus, 1974.
9. Martin-Löf, Per. (1974). "The notion of redundancy and its use as a quantitative measure of the discrepancy between a statistical hypothesis and a set of observational data". *Scand. J. Statist.*.
10. (2019). "Statistical Modelling by Exponential Families". *Cambridge University Press*.
11. (2006). "Encyclopedia of Statistical Sciences". *Wiley*.
12. (1987). ["Statistical Analysis with Missing Data"](https://archive.org/details/statisticalanaly00litt). *John Wiley & Sons*.
13. (1999). ["Learning in Graphical Models"](http://ftp.cs.toronto.edu/pub/radford/emk.pdf). *MIT Press*.
14. (2001). ["The Elements of Statistical Learning"](https://archive.org/details/elementsstatisti00thas_842). *Springer*.
15. (1988). "Newton—Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data". *Journal of the American Statistical Association*.
16. (2000). "Fitting Mixed-Effects Models Using Efficient EM-Type Algorithms". *Journal of Computational and Graphical Statistics*.
17. (2017). "A new REML (parameter expanded) EM algorithm for linear mixed models". *Australian & New Zealand Journal of Statistics*.
18. Matarazzo, T. J., and Pakzad, S. N. (2016). "STRIDE for Structural Identification using Expectation Maximization: Iterative Output-Only Method for Modal Identification." Journal of Engineering Mechanics.http://ascelibrary.org/doi/abs/10.1061/(ASCE)EM.1943-7889.0000951
19. (2022). ["Censored expectation maximization algorithm for mixtures: Application to intertrade waiting times"](https://www.sciencedirect.com/science/article/pii/S0378437121007299). *Physica A: Statistical Mechanics and Its Applications*.
20. (1997). "Acceleration of the EM Algorithm by using Quasi-Newton Methods". *[[Journal of the Royal Statistical Society, Series B]]*.
21. (1998). "Parameter expansion to accelerate EM: The PX-EM algorithm". *Biometrika*.
22. (1993). "Maximum likelihood estimation via the ECM algorithm: A general framework". *[[Biometrika]]*.
23. (1994). "The ECME Algorithm: A Simple Extension of EM and ECM with Faster Monotone Convergence". *Biometrika*.
24. Hunter DR and Lange K (2004), [http://www.stat.psu.edu/~dhunter/papers/mmtutorial.pdf A Tutorial on MM Algorithms], The American Statistician, 58: 30–37
25. (1979). "Maximum likelihood estimation in a linear model from confined and censored normal data". *[[Journal of the Royal Statistical Society, Series C]]*.
26. Pearson, Karl. (1894). "Contributions to the Mathematical Theory of Evolution". *Philosophical Transactions of the Royal Society of London A*.
27. (2015). ["Learning Latent Variable Models by Improving Spectral Solutions with Exterior Point Method"](https://www.cc.gatech.edu/~bboots3/files/SpectralExteriorPoint-NIPSWorkshop.pdf). *UAI*.
28. Balle, Borja Quattoni, Ariadna Carreras, Xavier. (2012-06-27). "Local Loss Optimization in Operator Models: A New Insight into Spectral Learning".
29. Lange, Kenneth. ["The MM Algorithm"](http://www.stat.berkeley.edu/~aldous/Colloq/lange-talk.pdf).
::callout[type=info title="Wikipedia Source"]
This article was imported from [Wikipedia](https://en.wikipedia.org/wiki/Expectation–maximization_algorithm) and is available under the [Creative Commons Attribution-ShareAlike 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/). Content has been adapted to SurfDoc format. Original contributors can be found on the [article history page](https://en.wikipedia.org/wiki/Expectation–maximization_algorithm?action=history).
::