Lecture 20 Properties of the EM Algorithm
In lecture 19 we introduced the EM algorithm for models with latent variables: starting from a guess , the algorithm alternates between computing the function in the E step and maximising it over in the M step, as in definition 19.2. In this lecture we prove that no step of the algorithm can decrease the observed-data log-likelihood, and that the fixed points of the iteration solve the likelihood equation. We then discuss the issues which arise when the algorithm is used in practice. We use the notation of lecture 19 throughout, and we continue with the two-component normal mixture of example 19.1.
20.1 The Ascent Property
The EM algorithm only ever maximises , and it is not obvious that this does anything for the observed-data log-likelihood . The central result of this lecture is that it does: no step of the algorithm can decrease . The proof rests on writing as the difference of and a second function , and we prove this decomposition first. We make three assumptions, which hold for the rest of this lecture:
- •
-
•
We have for every data point and every , so that is defined.
-
•
The conditional expectation is finite for all and every data point , so that is finite.
The following lemma gives the decomposition. The function in it is defined like , with the conditional density in place of the complete-data density .
For all we have
where is given by
We start from the formula for the conditional distribution of the latent variable. Solving it for and taking logarithms gives
for every with . By the first assumption, these are the values which can take, whatever the parameter. We now replace by the random variable and take conditional expectations given under . Since the left-hand side does not depend on , it stays the same, and we find
The first term on the right is finite by the third assumption, and thus so is the second. Summing this identity over the observations gives (20.1). This completes the proof. ∎
We now use the lemma to show that the EM algorithm can only increase the observed-data log-likelihood.
Let be generated by the EM algorithm from definition 19.2. Then
We first show that for all . Since is a sum over the observations, we only need to consider a single observation with observed value . Let . This value is well defined and positive by our assumption on the supports. Since is convex, we can use Jensen’s inequality, lemma A.7, for the conditional distribution of given under to get
since is a probability distribution over (with sums replaced by integrals for a continuous latent variable). This is the same argument as in the proof of lemma 16.2.
Now we can use lemma 20.1 with at and at , and taking the difference we get
The first bracket is non-negative, since is the maximiser of in the M step, and the second bracket is non-positive by the first step of the proof. Thus the difference is non-negative. This completes the proof. ∎
The statement of the proposition does not imply that EM finds the MLE: the sequence converges whenever is bounded above, but the iteration may stop at a local maximum or, in principle, at a saddle point. In general we can only say that the fixed points of the iteration are stationary points of .
Let be open and as well as differentiable for all . Then
In particular, if for some , the point is a root of the likelihood equation .
From lemma 20.1 we know that the function is differentiable. Furthermore, from the first step of the proof of proposition 20.2 we know that this function has its maximum at an interior point . Thus, the derivative at this point must be zero. Taking derivatives of the decomposition at gives the identity. If , then is an interior maximiser of and the right-hand side equals zero at . Thus we have . This completes the proof. ∎
For a vector parameter the same argument applies, but now using gradients instead of derivatives.
20.2 Practical Matters
Three issues arise whenever EM is used, and the mixture shows all three.
The first issue is the promised failure of identifiability. The parameter values and give the same density , and thus the model is not identifiable in the sense of definition 4.10. This is the difficulty foreshadowed after example 4.11. It is called label switching: the likelihood has two global maxima which are mirror images of each other. For the data of exercise 20.2, EM started from converges to , but started from it converges to . Either answer is fine on its own, but averaging different runs is not. The remedy of lecture 4 is to restrict the parameter space by a convention such as .
The second issue is local maxima. Proposition 20.2 guarantees ascent and nothing more, and a poor starting value can lead the iteration to a local maximum of without warning. The standard precaution is to run EM from several starting values and to keep the run with the largest observed-data log-likelihood, which we can always evaluate.
The third issue is when to stop. Since is non-decreasing, we stop when its increase falls below a small tolerance. Convergence is typically geometric near the fixed point, but can be slow.
Finally, EM produces an estimate but no standard error. The standard error is obtained afterwards from the observed information at the fixed point, as in section 17.3. Lecture 21 shows label switching, a starting value for which the iteration converges to a saddle point and the stopping rule in R.
-
•
We have shown that for all . The proof uses and Jensen’s inequality to show that the maximum of is attained at .
-
•
A fixed point of the EM iteration is a root of the likelihood equation.
-
•
Mixture parameters are only identifiable up to relabelling the components (label switching). Local maxima of the likelihood function can be avoided by running EM with different starting values and by comparing runs of the algorithm using the observed-data log-likelihood.
Suppose and are two known, distinct densities, and that are i.i.d. with density
where is the only unknown parameter. Let be the component observation belongs to, as in example 19.1.
-
1.
Write down the observed-data log-likelihood and the likelihood equation .
-
2.
Write down the complete-data log-likelihood and show that the E step determines the responsibilities and the M step determines the update .
-
3.
Show that and thus that . Deduce that is a fixed point of the EM iteration if and only if it solves the likelihood equation. This shows that for this model the converse of proposition 20.3 holds as well.
Consider the normal mixture of example 19.1 with , the observations and the initial value .
-
1.
Show that the responsibilities are , compute them to four decimal digits and use the updates (19.1) to find the first iterate .
-
2.
Compute the observed-data log-likelihood at and at , and show that the likelihood has increased. Which of the five observations contributes most to the increase in likelihood? Why?