Back to Classic ML Mind Map
中文·English
📊 Classic MLID: em-algorithm

EM Algorithm

EM 算法
🎯Core Definition
EM (expectation-maximization) is a general framework for maximum likelihood estimation in models with latent variables, alternating between an E-step and an M-step until convergence. The E-step fixes the current parameters θ(t)\theta^{(t)} and forms the expected complete-data log-likelihood under the latent posterior (a lower bound): Q(θθ(t))=EZX,θ(t)[logp(X,Zθ)]Q(\theta \mid \theta^{(t)}) = \mathbb{E}_{Z \mid X, \theta^{(t)}}[\log p(X, Z \mid \theta)]; the M-step maximizes it to obtain θ(t+1)=argmaxθQ(θθ(t))\theta^{(t+1)} = \arg\max_{\theta} Q(\theta \mid \theta^{(t)}).By Jensen's inequality (log is concave), logp(Xθ)EZX,θ(t)[logp(X,Zθ)]+H\log p(X \mid \theta) \ge \mathbb{E}_{Z \mid X, \theta^{(t)}}[\log p(X, Z \mid \theta)] + H, where HH is a constant w.r.t. θ\theta (the entropy of the latent posterior) — every iteration raises this lower bound, so logp(Xθ)\log p(X \mid \theta) never decreases, though only a local optimum is guaranteed.
💡Use Cases
GMM, HMM (Baum-Welch), missing-data imputation, factor analysis / probabilistic PCA, MT alignment; interviews always probe the E/M step definitions, the Jensen bound, and convergence.
Key Problems Solved
directly maximizing logp(Xθ)\log p(X \mid \theta) requires summing/integrating over latent variables, which is usually intractable; EM splits the hard problem via the “completed-data” trick — the E-step computes the latent posterior (soft completion), the M-step updates parameters in closed form on the completed sufficient statistics, each step being feasible while the likelihood rises monotonically. The cost: initialization-sensitive and only locally optimal (K-Means is a common GMM init).
🎯5 High-Frequency Exam Points
1
Write the E-step Q(θθ(t))=EZX,θ(t)[logp(X,Zθ)]Q(\theta \mid \theta^{(t)}) = \mathbb{E}_{Z \mid X, \theta^{(t)}}[\log p(X, Z \mid \theta)] and M-step; why is it called expectation-maximization?
2
Use Jensen's inequality to prove EM never decreases logp(Xθ)\log p(X \mid \theta); when is the lower bound tight?
3
Does EM reach a global or local optimum? Why is it initialization-sensitive? Common strategies such as K-Means to initialize GMM?
4
When is EM applicable — what are latent variables? How does EM handle missing data? vs direct gradient ascent?
5
How does E-step cost scale with the number of latent states? Which EM specializations are GMM and HMM (Baum-Welch)?
📖 In-depth Guide:📄 clustering-and-knn
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "EM Algorithm"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardDBSCAN & Hierarchical ClusteringNext CardGMM Soft Assignment

🔗 More Classic ML Knowledge Cards

AdaBoost DerivationBagging & Random ForestBaum-Welch (HMM EM)GBDT Negative Gradient