Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Expectation–maximization algorithm

From Wikipedia, the free encyclopedia
Iterative method for finding maximum likelihood estimates in statistical models
Part of a series on
Machine learning
anddata mining

Instatistics, anexpectation–maximization (EM)algorithm is aniterative method to find (local)maximum likelihood ormaximum a posteriori (MAP) estimates ofparameters instatistical models, where the model depends on unobservedlatent variables.[1] The EM iteration alternates between performing an expectation (E) step, which creates a function for the expectation of thelog-likelihood evaluated using the current estimate for the parameters, and a maximization (M) step, which computes parameters maximizing the expected log-likelihood found on theE step. These parameter-estimates are then used to determine the distribution of the latent variables in the next E step. It can be used, for example, to estimate a mixture ofgaussians, or to solve the multiple linear regression problem.[2]

EM clustering ofOld Faithful eruption data. The random initial model (which, due to the different scales of the axes, appears to be two very flat and wide ellipses) is fit to the observed data. In the first iterations, the model changes substantially, but then converges to the two modes of thegeyser. Visualized usingELKI.

History

[edit]

The EM algorithm was explained and given its name in a classic 1977 paper byArthur Dempster,Nan Laird, andDonald Rubin.[3] They pointed out that the method had been "proposed many times in special circumstances" by earlier authors. One of the earliest is the gene-counting method for estimating allele frequencies byCedric Smith.[4] Another was proposed byH.O. Hartley in 1958, and Hartley and Hocking in 1977, from which many of the ideas in the Dempster–Laird–Rubin paper originated.[5] Another one by S.K Ng, Thriyambakam Krishnan and G.J McLachlan in 1977.[6] Hartley’s ideas can be broadened to any grouped discrete distribution. A very detailed treatment of the EM method for exponential families was published by Rolf Sundberg in his thesis and several papers,[7][8][9] following his collaboration withPer Martin-Löf andAnders Martin-Löf.[10][11][12][13][14] The Dempster–Laird–Rubin paper in 1977 generalized the method and sketched a convergence analysis for a wider class of problems. The Dempster–Laird–Rubin paper established the EM method as an important tool of statistical analysis. See also Meng and van Dyk (1997).

The convergence analysis of the Dempster–Laird–Rubin algorithm was flawed and a correct convergence analysis was published byC. F. Jeff Wu in 1983.[15]Wu's proof established the EM method's convergence also outside of theexponential family, as claimed by Dempster–Laird–Rubin.[15]

Introduction

[edit]

The EM algorithm is used to find (local)maximum likelihood parameters of astatistical model in cases where the equations cannot be solved directly. Typically these models involvelatent variables in addition to unknownparameters and known data observations. That is, eithermissing values exist among the data, or the model can be formulated more simply by assuming the existence of further unobserved data points. For example, amixture model can be described more simply by assuming that each observed data point has a corresponding unobserved data point, or latent variable, specifying the mixture component to which each data point belongs.

Finding a maximum likelihood solution typically requires taking thederivatives of thelikelihood function with respect to all the unknown values, the parameters and the latent variables, and simultaneously solving the resulting equations. In statistical models with latent variables, this is usually impossible. Instead, the result is typically a set of interlocking equations in which the solution to the parameters requires the values of the latent variables and vice versa, but substituting one set of equations into the other produces an unsolvable equation.

The EM algorithm proceeds from the observation that there is a way to solve these two sets of equations numerically. One can simply pick arbitrary values for one of the two sets of unknowns, use them to estimate the second set, then use these new values to find a better estimate of the first set, and then keep alternating between the two until the resulting values both converge to fixed points. It's not obvious that this will work, but it can be proven in this context. Additionally, it can be proven that the derivative of the likelihood is (arbitrarily close to) zero at that point, which in turn means that the point is either a local maximum or asaddle point.[15] In general, multiple maxima may occur, with no guarantee that the global maximum will be found. Some likelihoods also havesingularities in them, i.e., nonsensical maxima. For example, one of thesolutions that may be found by EM in a mixture model involves setting one of the components to have zero variance and the mean parameter for the same component to be equal to one of the data points.

Description

[edit]

The symbols

[edit]

Given thestatistical model which generates a setX{\displaystyle \mathbf {X} } of observed data, a set of unobserved latent data ormissing valuesZ{\displaystyle \mathbf {Z} }, and a vector of unknown parametersθ{\displaystyle {\boldsymbol {\theta }}}, along with alikelihood functionL(θ;X,Z)=p(X,Zθ){\displaystyle L({\boldsymbol {\theta }};\mathbf {X} ,\mathbf {Z} )=p(\mathbf {X} ,\mathbf {Z} \mid {\boldsymbol {\theta }})}, themaximum likelihood estimate (MLE) of the unknown parameters is determined by maximizing themarginal likelihood of the observed data

L(θ;X)=p(Xθ)=p(X,Zθ)dZ=p(XZ,θ)p(Zθ)dZ{\displaystyle 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 sinceZ{\displaystyle \mathbf {Z} } is unobserved and the distribution ofZ{\displaystyle \mathbf {Z} } is unknown before attainingθ{\displaystyle {\boldsymbol {\theta }}}.

The EM algorithm

[edit]

The EM algorithm seeks to find the maximum likelihood estimate of the marginal likelihood by iteratively applying these two steps:

Expectation step (E step): DefineQ(θθ(t)){\displaystyle Q({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})} as theexpected value of the loglikelihood function ofθ{\displaystyle {\boldsymbol {\theta }}}, with respect to the currentconditional distribution ofZ{\displaystyle \mathbf {Z} } givenX{\displaystyle \mathbf {X} } and the current estimates of the parametersθ(t){\displaystyle {\boldsymbol {\theta }}^{(t)}}:
Q(θθ(t))=EZp(|X,θ(t))[logp(X,Z|θ)]{\displaystyle Q({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})=\operatorname {E} _{\mathbf {Z} \sim p(\cdot |\mathbf {X} ,{\boldsymbol {\theta }}^{(t)})}\left[\log p(\mathbf {X} ,\mathbf {Z} |{\boldsymbol {\theta }})\right]\,}
Maximization step (M step): Find the parameters that maximize this quantity:
θ(t+1)=argmaxθ Q(θθ(t)){\displaystyle {\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:θ(t+1)=argmaxθEZp(|X,θ(t))[logp(X,Z|θ)]{\displaystyle {\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

[edit]

The typical models to which EM is applied useZ{\displaystyle \mathbf {Z} } as a latent variable indicating membership in one of a set of groups:

  1. The observed data pointsX{\displaystyle \mathbf {X} } may bediscrete (taking values in a finite or countably infinite set) orcontinuous (taking values in an uncountably infinite set). Associated with each data point may be a vector of observations.
  2. Themissing values (akalatent variables)Z{\displaystyle \mathbf {Z} } arediscrete, drawn from a fixed number of values, and with one latent variable per observed unit.
  3. 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θ{\displaystyle {\boldsymbol {\theta }}} is known, usually the value of the latent variablesZ{\displaystyle \mathbf {Z} } can be found by maximizing the log-likelihood over all possible values ofZ{\displaystyle \mathbf {Z} }, either simply by iterating overZ{\displaystyle \mathbf {Z} } or through an algorithm such as theViterbi algorithm forhidden Markov models. Conversely, if we know the value of the latent variablesZ{\displaystyle \mathbf {Z} }, we can find an estimate of the parametersθ{\displaystyle {\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θ{\displaystyle {\boldsymbol {\theta }}} andZ{\displaystyle \mathbf {Z} } are unknown:

  1. First, initialize the parametersθ{\displaystyle {\boldsymbol {\theta }}} to some random values.
  2. Compute the probability of each possible value ofZ{\displaystyle \mathbf {Z} } , givenθ{\displaystyle {\boldsymbol {\theta }}}.
  3. Then, use the just-computed values ofZ{\displaystyle \mathbf {Z} } to compute a better estimate for the parametersθ{\displaystyle {\boldsymbol {\theta }}}.
  4. Iterate steps 2 and 3 until convergence.

The algorithm as just described monotonically approaches a local minimum of the cost function.

Properties

[edit]

Although an EM iteration does increase the observed data (i.e., marginal) likelihood function, no guarantee exists that the sequence converges to amaximum likelihood estimator. Formultimodal distributions, this means that an EM algorithm may converge to alocal maximum of the observed data likelihood function, depending on starting values. A variety of heuristic ormetaheuristic approaches exist to escape a local maximum, such as random-restarthill climbing (starting with several different random initial estimatesθ(t){\displaystyle {\boldsymbol {\theta }}^{(t)}}), or applyingsimulated annealing methods.

EM is especially useful when the likelihood is anexponential family, see Sundberg (2019, Ch. 8) for a comprehensive treatment:[16] the E step becomes the sum of expectations ofsufficient statistics, and the M step involves maximizing a linear function. In such a case, it is usually possible to deriveclosed-form expression updates for each step, using the Sundberg formula[17] (proved and published by Rolf Sundberg, based on unpublished results ofPer Martin-Löf andAnders Martin-Löf).[8][9][11][12][13][14]

The EM method was modified to computemaximum a posteriori (MAP) estimates forBayesian inference in the original paper by Dempster, Laird, and Rubin.

Other methods exist to find maximum likelihood estimates, such asgradient descent,conjugate gradient, or variants of theGauss–Newton algorithm. Unlike EM, such methods typically require the evaluation of first and/or second derivatives of the likelihood function.

Proof of correctness

[edit]

Expectation-Maximization works to improveQ(θθ(t)){\displaystyle Q({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})} rather than directly improvinglogp(Xθ){\displaystyle \log p(\mathbf {X} \mid {\boldsymbol {\theta }})}. Here it is shown that improvements to the former imply improvements to the latter.[18]

For anyZ{\displaystyle \mathbf {Z} } with non-zero probabilityp(ZX,θ){\displaystyle p(\mathbf {Z} \mid \mathbf {X} ,{\boldsymbol {\theta }})}, we can write

logp(Xθ)=logp(X,Zθ)logp(ZX,θ).{\displaystyle \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 dataZ{\displaystyle \mathbf {Z} } under the current parameter estimateθ(t){\displaystyle \theta ^{(t)}} by multiplying both sides byp(ZX,θ(t)){\displaystyle p(\mathbf {Z} \mid \mathbf {X} ,{\boldsymbol {\theta }}^{(t)})} and summing (or integrating) overZ{\displaystyle \mathbf {Z} }. The left-hand side is the expectation of a constant, so we get:

logp(Xθ)=Zp(ZX,θ(t))logp(X,Zθ)Zp(ZX,θ(t))logp(ZX,θ)=Q(θθ(t))+H(θθ(t)),{\displaystyle {\begin{aligned}\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{aligned}}}

whereH(θθ(t)){\displaystyle H({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})} is defined by the negated sum it is replacing.This last equation holds for every value ofθ{\displaystyle {\boldsymbol {\theta }}} includingθ=θ(t){\displaystyle {\boldsymbol {\theta }}={\boldsymbol {\theta }}^{(t)}},

logp(Xθ(t))=Q(θ(t)θ(t))+H(θ(t)θ(t)),{\displaystyle \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

logp(Xθ)logp(Xθ(t))=Q(θθ(t))Q(θ(t)θ(t))+H(θθ(t))H(θ(t)θ(t)).{\displaystyle \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 thatH(θθ(t))H(θ(t)θ(t)){\displaystyle H({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})\geq H({\boldsymbol {\theta }}^{(t)}\mid {\boldsymbol {\theta }}^{(t)})}, so we can conclude that

logp(Xθ)logp(Xθ(t))Q(θθ(t))Q(θ(t)θ(t)).{\displaystyle \log p(\mathbf {X} \mid {\boldsymbol {\theta }})-\log p(\mathbf {X} \mid {\boldsymbol {\theta }}^{(t)})\geq Q({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})-Q({\boldsymbol {\theta }}^{(t)}\mid {\boldsymbol {\theta }}^{(t)}).}

In words, choosingθ{\displaystyle {\boldsymbol {\theta }}} to improveQ(θθ(t)){\displaystyle Q({\boldsymbol {\theta }}\mid {\boldsymbol {\theta }}^{(t)})} causeslogp(Xθ){\displaystyle \log p(\mathbf {X} \mid {\boldsymbol {\theta }})} to improve at least as much.

As a maximization–maximization procedure

[edit]

The EM algorithm can be viewed as two alternating maximization steps, that is, as an example ofcoordinate descent.[19][20] Consider the function:

F(q,θ):=Eq[logL(θ;x,Z)]+H(q),{\displaystyle F(q,\theta ):=\operatorname {E} _{q}[\log L(\theta ;x,Z)]+H(q),}

whereq is an arbitrary probability distribution over the unobserved dataz andH(q) is theentropy of the distributionq. This function can be written as

F(q,θ)=DKL(qpZX(x;θ))+logL(θ;x),{\displaystyle F(q,\theta )=-D_{\mathrm {KL} }{\big (}q\parallel p_{Z\mid X}(\cdot \mid x;\theta ){\big )}+\log L(\theta ;x),}

wherepZX(x;θ){\displaystyle p_{Z\mid X}(\cdot \mid x;\theta )} is the conditional distribution of the unobserved data given the observed datax{\displaystyle x} andDKL{\displaystyle D_{KL}} is theKullback–Leibler divergence.

Then the steps in the EM algorithm may be viewed as:

Expectation step: Chooseq{\displaystyle q} to maximizeF{\displaystyle F}:
q(t)=argmaxq F(q,θ(t)){\displaystyle q^{(t)}=\operatorname {arg\,max} _{q}\ F(q,\theta ^{(t)})}
Maximization step: Chooseθ{\displaystyle \theta } to maximizeF{\displaystyle F}:
θ(t+1)=argmaxθ F(q(t),θ){\displaystyle \theta ^{(t+1)}=\operatorname {arg\,max} _{\theta }\ F(q^{(t)},\theta )}

Applications

[edit]

Filtering and smoothing EM algorithms

[edit]

AKalman 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 aKalman 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 themaximum likelihood calculation

σ^v2=1Nk=1N(zkx^k)2,{\displaystyle {\widehat {\sigma }}_{v}^{2}={\frac {1}{N}}\sum _{k=1}^{N}{(z_{k}-{\widehat {x}}_{k})}^{2},}

wherex^k{\displaystyle {\widehat {x}}_{k}} are scalar output estimates calculated by a filter or a smoother from N scalar measurementszk{\displaystyle 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

σ^w2=1Nk=1N(x^k+1F^x^k)2,{\displaystyle {\widehat {\sigma }}_{w}^{2}={\frac {1}{N}}\sum _{k=1}^{N}{({\widehat {x}}_{k+1}-{\widehat {F}}{\widehat {x}}_{k})}^{2},}

wherex^k{\displaystyle {\widehat {x}}_{k}} andx^k+1{\displaystyle {\widehat {x}}_{k+1}} are scalar state estimates calculated by a filter or a smoother. The updated model coefficient estimate is obtained via

F^=k=1N(x^k+1F^x^k)2k=1Nx^k2.{\displaystyle {\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.[26][27][28][29]

Variants

[edit]

A number of methods have been proposed to accelerate the sometimes slow convergence of the EM algorithm, such as those usingconjugate gradient and modifiedNewton's methods (Newton–Raphson).[30] 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".[31]

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.[32] Itself can be extended into theExpectation conditional maximization either (ECME) algorithm.[33]

This idea is further extended ingeneralized expectation maximization (GEM) algorithm, in which is sought only an increase in the objective functionF for both the E step and M step as described in theAs a maximization–maximization procedure section.[19] GEM is further developed in a distributed environment and shows promising results.[34]

It is also possible to consider the EM algorithm as a subclass of theMM (Majorize/Minimize or Minorize/Maximize, depending on context) algorithm,[35] and therefore use any machinery developed in the more general case.

α-EM algorithm

[edit]

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[36]which contains the log-EM algorithm as its subclass. Thus, the α-EM algorithm byYasuo 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.[37]

Relation to variational Bayes methods

[edit]

EM is a partially non-Bayesian, maximum likelihood method. Its final result gives aprobability distribution over the latent variables (in the Bayesian style) together with a point estimate forθ (either amaximum 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, wherek is the number of latent variables. Forgraphical models this is easy to do as each variable's newQ depends only on itsMarkov blanket, so localmessage passing can be used for efficient inference.

Geometric interpretation

[edit]
Further information:Information geometry

Ininformation geometry, the E step and the M step are interpreted as projections under dualaffine connections, called the e-connection and the m-connection; theKullback–Leibler divergence can also be understood in these terms.

Examples

[edit]

Gaussian mixture

[edit]
Comparison ofk-means and EM on artificial data visualized withELKI. Using the variances, the EM algorithm can describe the normal distributions exactly, while k-means splits the data inVoronoi-cells. The cluster center is indicated by the lighter, bigger symbol.
An animation demonstrating the EM algorithm fitting a two component Gaussianmixture model to theOld Faithful dataset. The algorithm steps through from a random initialization to convergence.

Letx=(x1,x2,,xn){\displaystyle \mathbf {x} =(\mathbf {x} _{1},\mathbf {x} _{2},\ldots ,\mathbf {x} _{n})} be a sample ofn{\displaystyle n} independent observations from amixture of twomultivariate normal distributions of dimensiond{\displaystyle d}, and letz=(z1,z2,,zn){\displaystyle \mathbf {z} =(z_{1},z_{2},\ldots ,z_{n})} be the latent variables that determine the component from which the observation originates.[20]

Xi(Zi=1)Nd(μ1,Σ1){\displaystyle X_{i}\mid (Z_{i}=1)\sim {\mathcal {N}}_{d}({\boldsymbol {\mu }}_{1},\Sigma _{1})} andXi(Zi=2)Nd(μ2,Σ2),{\displaystyle X_{i}\mid (Z_{i}=2)\sim {\mathcal {N}}_{d}({\boldsymbol {\mu }}_{2},\Sigma _{2}),}

where

P(Zi=1)=τ1{\displaystyle \operatorname {P} (Z_{i}=1)=\tau _{1}\,} andP(Zi=2)=τ2=1τ1.{\displaystyle \operatorname {P} (Z_{i}=2)=\tau _{2}=1-\tau _{1}.}

The aim is to estimate the unknown parameters representing themixing value between the Gaussians and the means and covariances of each:

θ=(τ,μ1,μ2,Σ1,Σ2),{\displaystyle \theta ={\big (}{\boldsymbol {\tau }},{\boldsymbol {\mu }}_{1},{\boldsymbol {\mu }}_{2},\Sigma _{1},\Sigma _{2}{\big )},}

where the incomplete-data likelihood function is

L(θ;x)=i=1nj=12τj f(xi;μj,Σj),{\displaystyle 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(θ;x,z)=p(x,zθ)=i=1nj=12 [f(xi;μj,Σj)τj]I(zi=j),{\displaystyle 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(θ;x,z)=exp{i=1nj=12I(zi=j)[logτj12log|Σj|12(xiμj)Σj1(xiμj)d2log(2π)]},{\displaystyle 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\},}

whereI{\displaystyle \mathbb {I} } is anindicator function andf{\displaystyle f} is theprobability density function of a multivariate normal.

In the last equality, for eachi, one indicatorI(zi=j){\displaystyle \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

[edit]

Given our current estimate of the parametersθ(t), the conditional distribution of theZi is determined byBayes' theorem to be the proportional height of the normaldensity weighted byτ:

Tj,i(t):=P(Zi=jXi=xi;θ(t))=τj(t) f(xi;μj(t),Σj(t))τ1(t) f(xi;μ1(t),Σ1(t))+τ2(t) f(xi;μ2(t),Σ2(t)).{\displaystyle 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:

Q(θθ(t))=EZX=x;θ(t)[logL(θ;x,Z)]=EZX=x;θ(t)[logi=1nL(θ;xi,Zi)]=EZX=x;θ(t)[i=1nlogL(θ;xi,Zi)]=i=1nEZiXi=xi;θ(t)[logL(θ;xi,Zi)]=i=1nj=12P(Zi=jXi=xi;θ(t))logL(θj;xi,j)=i=1nj=12Tj,i(t)[logτj12log|Σj|12(xiμj)Σj1(xiμj)d2log(2π)].{\displaystyle {\begin{aligned}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{aligned}}}

The expectation oflogL(θ;xi,Zi){\displaystyle \log L(\theta ;\mathbf {x} _{i},Z_{i})} inside the sum is taken with respect to the probability density functionP(ZiXi=xi;θ(t)){\displaystyle P(Z_{i}\mid X_{i}=\mathbf {x} _{i};\theta ^{(t)})}, which might be different for eachxi{\displaystyle \mathbf {x} _{i}} of the training set. Everything in the E step is known before the step is taken exceptTj,i{\displaystyle 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

[edit]

Q(θθ(t)){\displaystyle Q(\theta \mid \theta ^{(t)})} being quadratic in form means that determining the maximizing values ofθ{\displaystyle \theta } is relatively straightforward. Also,τ{\displaystyle \tau },(μ1,Σ1){\displaystyle ({\boldsymbol {\mu }}_{1},\Sigma _{1})} and(μ2,Σ2){\displaystyle ({\boldsymbol {\mu }}_{2},\Sigma _{2})} may all be maximized independently since they all appear in separate linear terms.

To begin, considerτ{\displaystyle \tau }, which has the constraintτ1+τ2=1{\displaystyle \tau _{1}+\tau _{2}=1}:

τ(t+1)=argmaxτ Q(θθ(t))=argmaxτ {[i=1nT1,i(t)]logτ1+[i=1nT2,i(t)]logτ2}.{\displaystyle {\begin{aligned}{\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{aligned}}}

This has the same form as the maximum likelihood estimate for thebinomial distribution, so

τj(t+1)=i=1nTj,i(t)i=1n(T1,i(t)+T2,i(t))=1ni=1nTj,i(t).{\displaystyle \tau _{j}^{(t+1)}={\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(μ1,Σ1){\displaystyle ({\boldsymbol {\mu }}_{1},\Sigma _{1})}:

(μ1(t+1),Σ1(t+1))=argmaxμ1,Σ1 Q(θθ(t))=argmaxμ1,Σ1 i=1nT1,i(t){12log|Σ1|12(xiμ1)Σ11(xiμ1)}.{\displaystyle {\begin{aligned}({\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{aligned}}.}

This has the same form as a weighted maximum likelihood estimate for a normal distribution, so

μ1(t+1)=i=1nT1,i(t)xii=1nT1,i(t){\displaystyle {\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Σ1(t+1)=i=1nT1,i(t)(xiμ1(t+1))(xiμ1(t+1))i=1nT1,i(t){\displaystyle \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,

μ2(t+1)=i=1nT2,i(t)xii=1nT2,i(t){\displaystyle {\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Σ2(t+1)=i=1nT2,i(t)(xiμ2(t+1))(xiμ2(t+1))i=1nT2,i(t).{\displaystyle \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

[edit]

Conclude the iterative process ifEZθ(t),x[logL(θ(t);x,Z)]EZθ(t1),x[logL(θ(t1);x,Z)]+ε{\displaystyle 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ε{\displaystyle \varepsilon } below some preset threshold.

Generalization

[edit]

The algorithm illustrated above can be generalized for mixtures of more than twomultivariate normal distributions.

Truncated and censored regression

[edit]

The EM algorithm has been implemented in the case where an underlyinglinear 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.[38] Special cases of this model include censored or truncated observations from onenormal distribution.[38]

Alternatives

[edit]

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 termedmoment-based approaches[39] or the so-calledspectral techniques.[40][41] 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.[citation needed]

See also

[edit]

References

[edit]
  1. ^Meng, X.-L.; van Dyk, D. (1997)."The EM algorithm – an old folk-song sung to a fast new tune".J. Royal Statist. Soc. B.59 (3):511–567.doi:10.1111/1467-9868.00082.S2CID 17461647.
  2. ^Jeongyeol Kwon, Constantine CaramanisProceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, PMLR 108:1727-1736, 2020.
  3. ^Dempster, A.P.;Laird, N.M.;Rubin, D.B. (1977). "Maximum Likelihood from Incomplete Data via the EM Algorithm".Journal of the Royal Statistical Society, Series B.39 (1):1–38.doi:10.1111/j.2517-6161.1977.tb01600.x.JSTOR 2984875.MR 0501537.
  4. ^Ceppelini, R.M. (1955). "The estimation of gene frequencies in a random-mating population".Ann. Hum. Genet.20 (2):97–115.doi:10.1111/j.1469-1809.1955.tb01360.x.PMID 13268982.S2CID 38625779.
  5. ^Hartley, Herman Otto (1958). "Maximum Likelihood estimation from incomplete data".Biometrics.14 (2):174–194.doi:10.2307/2527783.JSTOR 2527783.
  6. ^Ng, Shu Kay; Krishnan, Thriyambakam; McLachlan, Geoffrey J. (2011-12-21),"The EM Algorithm",Handbook of Computational Statistics, Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 139–172,doi:10.1007/978-3-642-21551-3_6,ISBN 978-3-642-21550-6,S2CID 59942212, retrieved2022-10-15
  7. ^Sundberg, Rolf (1974). "Maximum likelihood theory for incomplete data from an exponential family".Scandinavian Journal of Statistics.1 (2):49–58.JSTOR 4615553.MR 0381110.
  8. ^abRolf Sundberg. 1971.Maximum likelihood theory and applications for distributions generated when observing a function of an exponential family variable. Dissertation, Institute for Mathematical Statistics, Stockholm University.
  9. ^abSundberg, Rolf (1976). "An iterative method for solution of the likelihood equations for incomplete data from exponential families".Communications in Statistics – Simulation and Computation.5 (1):55–64.doi:10.1080/03610917608812007.MR 0443190.
  10. ^See the acknowledgement by Dempster, Laird and Rubin on pages 3, 5 and 11.
  11. ^abPer 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).
  12. ^abPer 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.
  13. ^abMartin-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,A. P. Dempster,D. Basu,D. R. Cox,A. W. F. Edwards, D. A. Sprott,G. A. Barnard, O. Barndorff-Nielsen, J. D. Kalbfleisch andG. 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.
  14. ^abMartin-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.1 (1):3–18.
  15. ^abcWu, C. F. Jeff (Mar 1983)."On the Convergence Properties of the EM Algorithm".Annals of Statistics.11 (1):95–103.doi:10.1214/aos/1176346060.JSTOR 2240463.MR 0684867.
  16. ^Sundberg, Rolf (2019).Statistical Modelling by Exponential Families. Cambridge University Press.ISBN 9781108701112.
  17. ^Laird, Nan (2006)."Sundberg formulas".Encyclopedia of Statistical Sciences. Wiley.doi:10.1002/0471667196.ess2643.pub2.ISBN 0471667196.
  18. ^Little, Roderick J.A.;Rubin, Donald B. (1987).Statistical Analysis with Missing Data. Wiley Series in Probability and Mathematical Statistics. New York: John Wiley & Sons. pp. 134–136.ISBN 978-0-471-80254-9.
  19. ^abNeal, Radford;Hinton, Geoffrey (1999). "A view of the EM algorithm that justifies incremental, sparse, and other variants". InMichael I. Jordan (ed.).Learning in Graphical Models(PDF). Cambridge, MA: MIT Press. pp. 355–368.ISBN 978-0-262-60032-3. Retrieved2009-03-22.
  20. ^abHastie, Trevor;Tibshirani, Robert; Friedman, Jerome (2001). "8.5 The EM algorithm".The Elements of Statistical Learning. New York: Springer. pp. 236–243.ISBN 978-0-387-95284-0.
  21. ^Lindstrom, Mary J; Bates, Douglas M (1988). "Newton—Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data".Journal of the American Statistical Association.83 (404): 1014.doi:10.1080/01621459.1988.10478693.
  22. ^Van Dyk, David A (2000). "Fitting Mixed-Effects Models Using Efficient EM-Type Algorithms".Journal of Computational and Graphical Statistics.9 (1):78–98.doi:10.2307/1390614.JSTOR 1390614.
  23. ^Diffey, S. M; Smith, A. B; Welsh, A. H; Cullis, B. R (2017)."A new REML (parameter expanded) EM algorithm for linear mixed models".Australian & New Zealand Journal of Statistics.59 (4): 433.doi:10.1111/anzs.12208.hdl:1885/211365.
  24. ^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
  25. ^Kreer, Markus; Kizilersu, Ayse; Thomas, Anthony W. (2022)."Censored expectation maximization algorithm for mixtures: Application to intertrade waiting times".Physica A: Statistical Mechanics and Its Applications.587 (1): 126456.Bibcode:2022PhyA..58726456K.doi:10.1016/j.physa.2021.126456.ISSN 0378-4371.S2CID 244198364.
  26. ^Einicke, G. A.; Malos, J. T.; Reid, D. C.; Hainsworth, D. W. (January 2009). "Riccati Equation and EM Algorithm Convergence for Inertial Navigation Alignment".IEEE Trans. Signal Process.57 (1):370–375.Bibcode:2009ITSP...57..370E.doi:10.1109/TSP.2008.2007090.S2CID 1930004.
  27. ^Einicke, G. A.; Falco, G.; Malos, J. T. (May 2010). "EM Algorithm State Matrix Estimation for Navigation".IEEE Signal Processing Letters.17 (5):437–440.Bibcode:2010ISPL...17..437E.doi:10.1109/LSP.2010.2043151.S2CID 14114266.
  28. ^Einicke, G. A.; Falco, G.; Dunn, M. T.; Reid, D. C. (May 2012). "Iterative Smoother-Based Variance Estimation".IEEE Signal Processing Letters.19 (5):275–278.Bibcode:2012ISPL...19..275E.doi:10.1109/LSP.2012.2190278.S2CID 17476971.
  29. ^Einicke, G. A. (Sep 2015). "Iterative Filtering and Smoothing of Measurements Possessing Poisson Noise".IEEE Transactions on Aerospace and Electronic Systems.51 (3):2205–2011.Bibcode:2015ITAES..51.2205E.doi:10.1109/TAES.2015.140843.S2CID 32667132.
  30. ^Jamshidian, Mortaza; Jennrich, Robert I. (1997). "Acceleration of the EM Algorithm by using Quasi-Newton Methods".Journal of the Royal Statistical Society, Series B.59 (2):569–587.doi:10.1111/1467-9868.00083.MR 1452026.S2CID 121966443.
  31. ^Liu, C (1998). "Parameter expansion to accelerate EM: The PX-EM algorithm".Biometrika.85 (4):755–770.CiteSeerX 10.1.1.134.9617.doi:10.1093/biomet/85.4.755.
  32. ^Meng, Xiao-Li;Rubin, Donald B. (1993). "Maximum likelihood estimation via the ECM algorithm: A general framework".Biometrika.80 (2):267–278.doi:10.1093/biomet/80.2.267.MR 1243503.S2CID 40571416.
  33. ^Liu, Chuanhai; Rubin, Donald B (1994). "The ECME Algorithm: A Simple Extension of EM and ECM with Faster Monotone Convergence".Biometrika.81 (4): 633.doi:10.1093/biomet/81.4.633.JSTOR 2337067.
  34. ^Jiangtao Yin; Yanfeng Zhang; Lixin Gao (2012)."Accelerating Expectation–Maximization Algorithms with Frequent Updates"(PDF).Proceedings of the IEEE International Conference on Cluster Computing.
  35. ^Hunter DR and Lange K (2004),A Tutorial on MM Algorithms, The American Statistician, 58: 30–37
  36. ^Matsuyama, Yasuo (2003). "The α-EM algorithm: Surrogate likelihood maximization using α-logarithmic information measures".IEEE Transactions on Information Theory.49 (3):692–706.doi:10.1109/TIT.2002.808105.
  37. ^Matsuyama, Yasuo (2011). "Hidden Markov model estimation based on alpha-EM algorithm: Discrete and continuous alpha-HMMs".International Joint Conference on Neural Networks:808–816.
  38. ^abWolynetz, M.S. (1979). "Maximum likelihood estimation in a linear model from confined and censored normal data".Journal of the Royal Statistical Society, Series C.28 (2):195–206.doi:10.2307/2346749.JSTOR 2346749.
  39. ^Pearson, Karl (1894)."Contributions to the Mathematical Theory of Evolution".Philosophical Transactions of the Royal Society of London A.185:71–110.Bibcode:1894RSPTA.185...71P.doi:10.1098/rsta.1894.0003.ISSN 0264-3820.JSTOR 90667.
  40. ^Shaban, Amirreza; Mehrdad, Farajtabar; Bo, Xie; Le, Song; Byron, Boots (2015)."Learning Latent Variable Models by Improving Spectral Solutions with Exterior Point Method"(PDF).UAI:792–801. Archived fromthe original(PDF) on 2016-12-24. Retrieved2019-06-12.
  41. ^Balle, Borja Quattoni, Ariadna Carreras, Xavier (2012-06-27).Local Loss Optimization in Operator Models: A New Insight into Spectral Learning.OCLC 815865081.{{cite book}}: CS1 maint: multiple names: authors list (link)
  42. ^Lange, Kenneth."The MM Algorithm"(PDF).

Further reading

[edit]

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Expectation–maximization_algorithm&oldid=1297006206"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp