A latent-variable model specifies a joint law for an observation and an unobserved variable . The likelihood of the observed data uses the marginal law of . The EM algorithm relates these two likelihoods through the conditional distribution of given the actual observations.
Joint, marginal, and posterior¶
Let be a joint density with respect to fixed measures . Its marginal and posterior densities are
The posterior is defined where . Integrals become sums for discrete latent variables. Assume throughout the following derivation that the densities have common positive support at the observations and that the log densities, posterior entropies, and KL terms used below are integrable.
For independent observations , the objective is the average observed log likelihood
Even if is easy to optimize, the integral inside may make direct optimization difficult.
A variational identity at each observation¶
For any conditional density with the required support and finite terms, define
KL divergence is , with natural logarithms. It is nonnegative: Jensen’s inequality applied to gives when the supports agree. The more general support case gives the same inequality, or infinite KL if vanishes on a set of positive mass. Equality holds exactly when the two distributions agree.
Substituting into gives the exact identity
Thus is a lower bound on the likelihood, tight when each is the posterior at the current parameter. This is the free-energy formulation of EM developed by Neal and Hinton in A view of the EM algorithm that justifies incremental, sparse, and other variants.
The two steps and the likelihood inequality¶
At iteration , the E-step sets and forms
The expectation uses ; the log joint density inside it uses the candidate parameter . During the M-step, keep the posterior fixed and choose a maximizer of , assuming one exists in the specified parameter set. The entropy of is constant in this optimization, so maximizing also maximizes .
Equation (4) now gives
Increasing instead of maximizing it is enough for this inequality; that is a generalized EM step. Likelihood monotonicity does not establish a global maximum, convergence of the parameter sequence, or a convergence rate.
The E-step is also not, in general, a substitution . For a nonlinear term, such as or , its posterior expectation must be computed separately. In particular, when the second moment exists.
Example: one unknown mixing weight¶
Let have probability . Given , has known density ; given , it has known density . Assume both are positive and finite at each . Then
The E-step computes the posterior probabilities, often called responsibilities:
With these values fixed, let . Then
Its derivative vanishes at , and its second derivative is negative. Hence the exact update is
Here a posterior mean suffices because the complete log likelihood depends affinely on the binary variable . For a concrete step, suppose and the likelihood ratios at two observations are 3 and . The responsibilities are and , giving .
If everywhere, the marginal law does not depend on . Then and every update stays in place. A well-defined EM formula alone does not establish identifiability.
Exponential-family completion¶
Suppose the joint is a full regular minimal exponential family in natural coordinates:
The E-step averages the entire sufficient-statistic vector:
Then . If an interior unconstrained M-step exists, the moment-matching equation becomes
Constraints can change this equation, and the posterior moments need not lie in the attainable interior. These are optimization and model-domain questions, not consequences of the EM inequality.
The derivation used actual observations throughout. For continuous data, the empirical distribution is atomic and its KL to a continuous model is generally infinite. Ordinary EM requires no such KL. A later population projection construction must specify a suitable observable density and its support.
Continue with conditional expectation as projection. The duality note introduces a different, KL-based projection, and the hub places both in the reading path.