5.8 Formalizing Expectation Maximization
5.8 Formalizing Expectation Maximization
Section titled “5.8 Formalizing Expectation Maximization”Learning Objectives
Section titled “Learning Objectives”After reading this section, you should be able to:
- distinguish between complete-data and observed-data likelihood
- understand why marginal likelihood is difficult to optimize directly
- define the EM auxiliary function
- describe the formal roles of the E-step and M-step
- explain how EM transforms an intractable optimization into an iterative procedure
Returning to the Motif Problem
Section titled “Returning to the Motif Problem”Returning to the motif discovery problem, we now seek to make the EM idea precise. We have seen that the difficulty arises from missing information: the motif positions are unknown, yet they are required to estimate the motif model.
This situation is not unique to motif discovery. More generally, we are given observed data, but part of the structure that explains this data is hidden. Our goal is to estimate the parameters of a model that best explains the observations, despite this incomplete information.
To formalize this, we introduce a general notation that applies both to the coin toss example and to motif discovery.
Observed Data, Hidden Variables, and Parameters
Section titled “Observed Data, Hidden Variables, and Parameters”We denote the observed data by . In motif discovery, this corresponds to the sequences. We denote the hidden variables by , which represent the unknown motif positions. Finally, we denote the model parameters by , which define the motif model.
If both and were known, we could write down the complete-data likelihood
Maximizing this quantity with respect to would typically be straightforward, because the hidden structure would be explicitly available.
However, in practice we only observe , not . The relevant quantity is therefore the marginal likelihood
which accounts for all possible configurations of the hidden variables.
The Challenge of Marginal Likelihood
Section titled “The Challenge of Marginal Likelihood”At first glance, one might attempt to maximize this marginal likelihood directly. However, this turns out to be difficult for two reasons.
First, the number of possible configurations of can be very large. In motif discovery, each possible assignment of motif positions corresponds to a different configuration.
Second, optimization is typically performed on the log-likelihood:
The presence of the logarithm outside the sum prevents us from decomposing the expression into simpler terms. This makes direct optimization intractable in many cases.
This is precisely where the EM idea becomes useful.
Introducing an Auxiliary Objective
Section titled “Introducing an Auxiliary Objective”Instead of maximizing the marginal likelihood directly, EM introduces an alternative objective that is easier to handle.
Given a current parameter estimate ( \theta^{(t)} ), we consider the conditional distribution of the hidden variables:
This distribution represents our current belief about the hidden structure.
Using this distribution, we define the function
This function can be interpreted as the expected complete-data log-likelihood under the current estimate of the hidden variables. Crucially, it is much easier to optimize than the original marginal likelihood.
The Expectation Step
Section titled “The Expectation Step”In the Expectation step, we compute the distribution and use it to evaluate the function .
Conceptually, this corresponds to estimating the hidden variables given the current model. Instead of selecting a single configuration of , we consider all possible configurations and weight them according to their probability.
This step mirrors what we observed in the coin toss example, where each sequence contributed probabilistically to both coins.
The Maximization Step
Section titled “The Maximization Step”In the Maximization step, we update the parameters by maximizing the function :
This step yields new parameter values that best explain the data under the current probabilistic assignments of the hidden variables.
In many cases, including motif discovery, this maximization has a simple form and corresponds to computing weighted averages or counts, as we saw earlier.
Why This Procedure Works
Section titled “Why This Procedure Works”At this point, the EM algorithm can be understood as transforming a difficult optimization problem into a sequence of simpler ones.
Instead of maximizing the marginal likelihood directly, we alternate between:
- estimating the hidden variables (E-step)
- optimizing the parameters given these estimates (M-step)
Each step simplifies the problem by temporarily fixing one aspect of the uncertainty.
A key property of this procedure is that it improves the likelihood of the observed data at each iteration, or at least does not decrease it . As a result, the algorithm converges to a stable solution.
From Formalism Back to Biology
Section titled “From Formalism Back to Biology”Although the notation may appear abstract, the underlying idea remains closely tied to the motif discovery problem.
- corresponds to the sequences
- corresponds to the unknown motif positions
- corresponds to the motif model
The EM algorithm provides a principled way to estimate even though is not observed. By iteratively refining both, it resolves the circular dependency identified earlier.
In the next section, we will examine the behavior of this procedure in more detail and interpret what the algorithm is optimizing during its iterations.
Self-Check Questions
Section titled “Self-Check Questions”- What is the difference between complete-data likelihood and marginal likelihood?
- Why is the marginal likelihood difficult to optimize directly?
- What does the function represent?
- What is computed in the E-step, and how should it be interpreted?
- What is optimized in the M-step?
- Why does EM improve the likelihood at each iteration?