Back to the 2025 paper

Unit 5: Specialized Learning Theories

20257m

Explain the EM algorithm. Describe the E-step and M-step with an example of parameter estimation in a mixture model.

Worked SolutionAI Assisted

EM Algorithm (Expectation-Maximization):

Iterative method for MLE in presence of latent variables ZZ (e.g., mixture components, missing data). Maximizes log⁡p(X∣θ)=log⁡∑Zp(X,Z∣θ)\log p(X|\theta)=\log\sum_Z p(X,Z|\theta) intractable directly.

Idea: Iteratively construct lower bound via Jensen, maximize it.

Steps:
Given data XX, latent ZZ, parameters θ\theta.

  • E-step (Expectation): Compute posterior q(Z)=p(Z∣X,θ(t))q(Z)=p(Z|X,\theta^{(t)}) and expected complete log-likelihood Q(θ∣θ(t))=EZ∣X,θ(t)[log⁡p(X,Z∣θ)]=∑Zp(Z∣X,θ(t))log⁡p(X,Z∣θ)Q(\theta|\theta^{(t)})=E_{Z|X,\theta^{(t)}}[\log p(X,Z|\theta)] = \sum_Z p(Z|X,\theta^{(t)})\log p(X,Z|\theta)
    Equivalent to computing responsibilities γnk=p(zk=1∣xn,θ(t))\gamma_{nk}=p(z_k=1|x_n,\theta^{(t)}).

  • M-step (Maximization): θ(t+1)=arg⁡max⁡θQ(θ∣θ(t))\theta^{(t+1)}=\arg\max_\theta Q(\theta|\theta^{(t)})

Iterate until log⁡p(X∣θ(t+1))−log⁡p(X∣θ(t))<ϵ\log p(X|\theta^{(t+1)})-\log p(X|\theta^{(t)})<\epsilon. Guaranteed monotonic increase, converges to local optimum (not necessarily global; restart needed).

Example — Gaussian Mixture Model (GMM) with KK components:

Model: p(x)=∑k=1KπkN(x∣μk,Σk)p(x)=\sum_{k=1}^K \pi_k N(x|\mu_k,\Sigma_k), latent znk∈{0,1}z_{nk}\in\{0,1\} indicates component.

E-step: γnk=πkN(xn∣μk,Σk)∑jπjN(xn∣μj,Σj)\gamma_{nk}= \frac{\pi_k N(x_n|\mu_k,\Sigma_k)}{\sum_j \pi_j N(x_n|\mu_j,\Sigma_j)}

M-step: Nk=∑nγnkN_k=\sum_n\gamma_{nk}, πknew=Nk/N\pi_k^{new}=N_k/N, μknew=1Nk∑nγnkxn\mu_k^{new}=\frac1{N_k}\sum_n\gamma_{nk}x_n, Σknew=1Nk∑nγnk(xn−μknew)(xn−μknew)T\Sigma_k^{new}=\frac1{N_k}\sum_n\gamma_{nk}(x_n-\mu_k^{new})(x_n-\mu_k^{new})^T

Example numbers: Data {1,2,10}, K=2K=2 init μ1=1,μ2=10\mu_1=1,\mu_2=10 → E-step assigns 1,2 to component1 (γ≈1\gamma\approx1), 10 to component2 → M-step updates μ1→1.5\mu_1\to1.5, μ2→10\mu_2\to10 → iterates.

EM also used in HMM (Baum-Welch), k-means is hard-assignment limit of GMM-EM with spherical Σ→0\Sigma\to0.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.