The expectation-maximization algorithm is an approach in which values of the statistics which would be computed if a complete dataset were available are estimated (imputed), taking into account the pattern of missing data.
Author
Yupng L.
Published
December 10, 2025
Notation for Missingness
Data matrix \(Y\), missing data matrix \(M=\left \{M_{ij} \right \}\).
Multivariate: \(M_{ij}=0\) unless \(j \in J \subset V\) (in my understanding, \(V\) is the set of variables). Example: For some subjects, both R and S unobserved.
Monotone: There is an ordering of \(V\) so \(M_{ik} = 0\) implies \(M_{ij} = 0\) for \(j < k\), e.g. drop-out in longitudinal studies. Example: For some, A is unobserved, others neither A nor R, but data otherwise complete.
Disjoint: Two subsets of variables never observed together. Controversial. Appears in Rubin’s causal model. Example: S and R never both observed.
General: none of the above. Haphazardly scattered missing values. Example: R unobserved for some, A unobserved for others, S,D for some.
Latent: A certain variable is never observed. Maybe it is even unobservable. Example: S never observed, but believed to be important for explaining the data.
Methods for Dealing with Missing Data
Complete case analysis: analyse only cases where all variables are observed.
Weighting methods. For example, if a population total \(\mu = E(Y)\) should be estimated and unit \(i\) has been selected with probability \(π_i\) a standard method is the Horwitz–Thompson estimator.
Imputation methods: Find ways of estimating the values of the unobserved values as \(Y_{miss}\), then proceed as if there were complete data. Without care, this can give misleading results, in particular because the ”sample size” can be grossly overestimated.
Model-based likelihood methods: Model the missing data mechanism and then proceed to make a proper likelihood-based analysis, either via the method of maximum-likelihood or using Bayesian methods. This appears to be the most sensible way. Typically this approach was not computationally feasible in the past, but modern algorithms and computers have changed things completely. Ironically, the efficient algorithms are indeed based upon imputation of missing values, but with proper corrections resulting.
Mechanisms of Missingness
MCAR
\[P(M = 1 | Y_{obs}, Y_{miss}) = P(M = 1)\]
Interpretation: The probability that data is missing is independent of both observed and unobserved data. The missingness is completely random and unrelated to any variables in the dataset.
Example: Example is recording error, latent variables, and variables that are missing by design (e.g. measuring certain values only for the first m out of n cases). Beware: it may be counterintuitive that missing by design is MCAR.
Interpretation: The probability of missingness depends only on the observed data, not on the missing values themselves. Given the observed data, the missingness is random.
Example: Heuristically, only the observed values of \(Y\) have influence on the missingness. By design, e.g. if individuals with certain characteristics of \(Y_{obs}\) are not included in part of study (where \(Y_{miss}\) is measured).
Interpretation: The probability of missingness depends on the unobserved (missing) values themselves, even after accounting for observed data. This is the most challenging scenario.
Example: In an income survey, people with very high or very low incomes may be less likely to report their earnings, and this missingness depends on the actual (unobserved) income value. Another example will be: for example, if certain values of \(Y\) cannot be recorded when they are out of range, e.g. in survival analysis (censoring is another kind of missing data).
Summary
Mechanism
Depends on \(Y_{obs}\)
Depends on \(Y_{miss}\)
Bias in Complete Case Analysis
MCAR
No
No
No (but loss of efficiency)
MAR
Yes
No
Potentially Yes
MNAR
Yes
Yes
Yes
MCAR: Complete case analysis is unbiased but inefficient. Simple methods like list-wise deletion are acceptable.
MAR: Multiple imputation and maximum likelihood methods can produce unbiased estimates if the model is correctly specified.
MNAR: Requires sensitivity analysis and specialized models. Assumptions about the missingness mechanism must be made explicit.
# Simulate data with different missing mechanismsset.seed(123)n <-1000# Complete data - from model y=2+3x+resid x <-rnorm(n)y <-2+3*x +rnorm(n)# MCAR: 20% missing completely at randomy_mcar <- ymissing_mcar <-sample(1:n, size =0.2*n)y_mcar[missing_mcar] <-NA# MAR: missingness depends on xprob_mar <-plogis(-1+1.5*x) # Higher x increases missing probabilitymissing_mar <-rbinom(n, 1, prob_mar) ==1y_mar <- yy_mar[missing_mar] <-NA# MNAR: missingness depends on y itselfprob_mnar <-plogis(-1+0.5*y) # Higher y increases missing probabilitymissing_mnar <-rbinom(n, 1, prob_mnar) ==1y_mnar <- yy_mnar[missing_mnar] <-NA# Summarycat("Proportion missing:\n")
Proportion missing:
cat("MCAR:", mean(is.na(y_mcar)), "\n")
MCAR: 0.2
cat("MAR:", mean(is.na(y_mar)), "\n")
MAR: 0.323
cat("MNAR:", mean(is.na(y_mnar)), "\n")
MNAR: 0.5
Likelihood-based Methods
Complete Data and Observed Data Likelihood
Joint Likelihood: The complete data likelihood can be factored as:
\[L(\theta, \phi | Y, M) = f(Y, M | \theta, \phi) = f(Y | \theta) \cdot f(M | Y, \phi)\]
or written as \(L(\theta, \phi | Y, M) = P(Y, M | \theta, \phi) = P(Y | \theta) \cdot P(M | Y, \phi)\).
where:
\(\theta\): parameters of the data model
\(\phi\): parameters of the missingness model
The data likelihood \(P(Y_{obs}, Y_{miss} | \theta)\). The missingness probability \(P(M | Y_{obs}, Y_{miss}, \phi)\)
Ignorability Condition
The missing data mechanism is ignorable for likelihood-based inference if the following two conditions hold:
Parameter Distinctness: \(\theta\) and \(\phi\) are distinct (parameter spaces are separable [意义在于可直接相乘,进而分解Likelihood (separable)。见以下“Under Ignorability”章节。进一步的理解是,Joint parameter space of \((\theta,\phi)\) 必须可以分解为两个独立的parameter spaces的Cartesian Product,即\(\text{for }\theta \in \Theta \text{ and } \phi \in \Phi:\) 有\((\theta,\phi)\in \Theta \times \Phi\)]).
For the 2nd condition: the parameters \(\theta\) (for the data model) and \(\phi\) (for the missing mechanism) are distinct—knowing \(\theta\) tells us nothing about \(\phi\), and vice versa…
When both conditions hold, we can ignore the missing data mechanism and still make valid likelihood-based inferences about \(\theta\).
Implication
Under ignorability, the likelihood can be written as:
Since we’re only interested in \(\theta\), we can ignore the missingness mechanism and work with [因为distinctness,我们可以最大化\(\theta\)的似然函数,而不用考虑missing data]:
This integral often has no closed form, making direct optimization intractable.
The solution: The EM algorithm iteratively maximizes a more tractable quantity.
2. The Q-Function
Since we don’t know \(Y_{miss}\), we take the expected value of the complete data log-likelihood, where the expectation is over the conditional distribution of \(Y_{miss}\) given \(Y_{obs}\) and current parameter estimate \(\theta^{(t)}\).
Define the Q-function - the expectation of complete data log-likelihood:
Both terms are non-negative, so \(\ell(\theta^{(t+1)}) \geq \ell(\theta^{(t)})\).
Theorem - Convergence property of the EM
Under some conditions, the sequence \(\{ \theta^{(t)} \}\) defined by the EM iterations converges to a stationary point of the observed data log-likelihood.
5. EM for Exponential Families
When the complete data distribution belongs to an exponential family, EM simplifies beautifully.
Instead of computing: \[T(Y_{obs}, Y_{miss}) \quad \text{← Can't do this! We don't have } Y_{miss}\]
We compute: \[\hat{T}^{(t)} = E[T(Y_{obs}, Y_{miss})| Y_{obs}, \theta^{(t)}]\]
We can’t calculate the sufficient statistics from complete data. So we calculate the average sufficient statistics across all possible values the missing data could be. This average is weighted by how likely each value is given what we observe.
This is exactly the same as the complete data MLE, except we use \(\hat{T}^{(t)}\) instead of \(T(Y)\).
Comments: from the above E-step and M-step, in such cases, the computational problem is effectively confined to the E-step, which involves estimating (or “imputing”) the statistics \(T(Y)\), using the step shown in E-Step Simplification.
6. Concrete Example: Univariate Normal with Missing Data
Setup
\(Y_i \stackrel{iid}{\sim} N(\mu, \sigma^2)\) for \(i = 1, \ldots, n\)
\(Y_{obs} = \{Y_i : M_i = 0\}\) with \(n_{obs}\) observations
Likelihood-based methods provide a principled approach to handling missing data:
Ignorability: Under MAR and parameter distinctness, we can ignore the missingness mechanism
EM Algorithm: Iterative method for finding MLEs with missing data
Direct MLE: Numerical optimization of observed data likelihood
Inference: Standard errors and confidence intervals from the observed information matrix
These methods form the foundation for modern missing data analysis and are implemented in many statistical software packages.
Reference
Little, R. and Rubin, D. (2019). Maximum Likelihood for General Patterns of Missing Data: Introduction and Theory with Ignorable Nonresponse. In Statistical Analysis with Missing Data, Third Edition (eds R. Little and D. Rubin). https://doi.org/10.1002/9781119482260.ch8
Appendix 1. Deriving the Full Likelihood for Missing Data
Starting Point: What We Want
We want to write the likelihood of parameters \((\theta, \phi)\) given what we observe: \((Y_{obs}, M)\).
By definition of likelihood: \[L(\theta, \phi | Y_{obs}, M) = P(Y_{obs}, M | \theta, \phi)\]
Key insight: We observe \((Y_{obs}, M)\), but \(Y_{miss}\) is unobserved. We need to account for all possible values of \(Y_{miss}\).
Step-by-Step Derivation
Step 1: Introduce the Missing Data
Since \(Y = (Y_{obs}, Y_{miss})\) is the complete data, we can write:
\[P(Y_{obs}, M | \theta, \phi) = \int P(Y_{obs}, Y_{miss}, M | \theta, \phi) \, dY_{miss}\]
The probability of what we observe is the sum (integral) over all possible values of what we don’t observe.
This is the law of total probability (or marginalization).
Step 2: Factor the Joint Distribution
Now we factor \(P(Y_{obs}, Y_{miss}, M | \theta, \phi)\) using the chain rule of probability: