Skip to content
BIASED

EM and Bayesian PCA

Latent variables and the EM algorithm: the ELBO + KL decomposition of the log-likelihood, E- and M-steps with old and new parameters, Gaussian mixture updates on a seven-point example, why the likelihood never decreases, probabilistic PCA in closed form and by EM, and Bayesian PCA, which switches off unneeded columns.

Latent variables and mixtures

In the topic The Laplace approximation and Bayesian classification we found the mode of a posterior by Newton's method and put a Gaussian there. That worked because the log-posterior was a sum of simple terms. Now each object gets a hidden part that we never observe, and even finding the mode becomes hard.

A latent variable ziz_i is a quantity attached to the object xix_i that the model uses but the data do not contain. The classic example is a mixture of Gaussians. Each point first picks a component kk with probability πk\pi_k, then is drawn from that component:

p(zi=k)=πk,xi∣zi=k∼N(μk,σk2),∑k=1Kπk=1.p(z_i = k) = \pi_k, \qquad x_i \mid z_i = k \sim \mathcal N(\mu_k, \sigma_k^2), \qquad \sum_{k=1}^{K} \pi_k = 1.

The parameters are θ={πk,μk,σk2}k=1K\theta = \{\pi_k, \mu_k, \sigma_k^2\}_{k=1}^K. We observe only X=(x1,…,xn)X = (x_1, \dots, x_n), so the likelihood sums the latent variable out:

ℓ(θ)=log⁡p(X∣θ)=∑i=1nlog⁡∑k=1Kπk N(xi∣μk,σk2).\ell(\theta) = \log p(X \mid \theta) = \sum_{i=1}^{n} \log \sum_{k=1}^{K} \pi_k\, \mathcal N(x_i \mid \mu_k, \sigma_k^2).

The logarithm sits outside the inner sum. Setting the gradient to zero couples all components at once, and there is no closed-form solution.

Compare this with the complete-data log-likelihood, the one we would have if the labels Z=(z1,…,zn)Z = (z_1, \dots, z_n) were known:

log⁡p(X,Z∣θ)=∑i=1n[log⁡πzi+log⁡N(xi∣μzi,σzi2)].\log p(X, Z \mid \theta) = \sum_{i=1}^{n} \Big[ \log \pi_{z_i} + \log \mathcal N(x_i \mid \mu_{z_i}, \sigma_{z_i}^2) \Big].

Here the logarithm acts on single terms, and the problem splits into one small Gaussian fit per component. EM exploits exactly this: we do not know ZZ, but for given θ\theta we know its posterior, and we can average the easy complete-data log-likelihood over it.

Running example. Seven points on a line,

x=(−0.8, −0.2, 0.3, 0.9, 2.1, 2.8, 3.4),x = (-0.8,\ -0.2,\ 0.3,\ 0.9,\ 2.1,\ 2.8,\ 3.4),

and a mixture of two components with unit variances:

p(x∣θ)=π N(x∣μ1,1)+(1−π) N(x∣μ2,1),θ=(π,μ1,μ2).p(x \mid \theta) = \pi\, \mathcal N(x \mid \mu_1, 1) + (1 - \pi)\, \mathcal N(x \mid \mu_2, 1), \qquad \theta = (\pi, \mu_1, \mu_2).

Here π\pi is the weight of the first component, not 3.143.14. We start from θ(0)=(0.5, 0, 1)\theta^{(0)} = (0.5,\ 0,\ 1), where ℓ(θ(0))=−14.69\ell(\theta^{(0)}) = -14.69. Later topics of the course return to this mixture.

Log-likelihood = ELBO + KL

Take any distribution q(Z)q(Z) over the latent variables. For every value of ZZ the product rule gives p(X,Z∣θ)=p(Z∣X,θ) p(X∣θ)p(X, Z \mid \theta) = p(Z \mid X, \theta)\, p(X \mid \theta), so

log⁡p(X∣θ)=log⁡p(X,Z∣θ)−log⁡p(Z∣X,θ).\log p(X \mid \theta) = \log p(X, Z \mid \theta) - \log p(Z \mid X, \theta).

The left side does not depend on ZZ. Average both sides over q(Z)q(Z), then add and subtract Eq[log⁡q(Z)]\mathbb E_q[\log q(Z)]:

log⁡p(X∣θ)=Eq[log⁡p(X,Z∣θ)]−Eq[log⁡q(Z)]⏟L(q, θ)+Eq ⁣[log⁡q(Z)p(Z∣X,θ)]⏟KL(q ∥ p(Z∣X, θ)).\log p(X \mid \theta) = \underbrace{\mathbb E_q\big[\log p(X, Z \mid \theta)\big] - \mathbb E_q\big[\log q(Z)\big]}_{\mathcal L(q,\, \theta)} + \underbrace{\mathbb E_q\!\left[\log \frac{q(Z)}{p(Z \mid X, \theta)}\right]}_{\mathrm{KL}(q \,\|\, p(Z \mid X,\, \theta))}.

The first part is the evidence lower bound (ELBO). It equals the expected complete-data log-likelihood plus the entropy of qq:

L(q,θ)=Eq[log⁡p(X,Z∣θ)]+H(q),H(q)=−Eq[log⁡q(Z)].\mathcal L(q, \theta) = \mathbb E_q\big[\log p(X, Z \mid \theta)\big] + H(q), \qquad H(q) = -\mathbb E_q[\log q(Z)].

The second part is a KL divergence, which is never negative. Hence L(q,θ)≤log⁡p(X∣θ)\mathcal L(q, \theta) \le \log p(X \mid \theta) for every qq and every θ\theta, and the gap is exactly KL(q ∥ p(Z∣X,θ))\mathrm{KL}(q \,\|\, p(Z \mid X, \theta)). The gap vanishes only when qq is the exact posterior over ZZ.

In a mixture the points are independent given θ\theta, so the posterior factorizes over points: p(Z∣X,θ)=∏ip(zi∣xi,θ)p(Z \mid X, \theta) = \prod_i p(z_i \mid x_i, \theta). If qq factorizes the same way, the gap is a sum of per-point KL divergences.

A small case on the running example. At θ(0)\theta^{(0)} the point x=0.9x = 0.9 has posterior p(z=1∣x,θ(0))=0.401p(z = 1 \mid x, \theta^{(0)}) = 0.401 by Bayes' rule. Suppose we assign it to the second component with certainty, q=(0,1)q = (0, 1). The KL from a point mass is minus the log-probability of the chosen value, so this point alone opens a gap of −log⁡0.599=0.513-\log 0.599 = 0.513 nats.

E-step and M-step

The decomposition turns one hard maximization into two easy ones. EM is coordinate ascent on L(q,θ)\mathcal L(q, \theta): it alternates between qq and θ\theta. Write θold=θ(t)\theta^{\text{old}} = \theta^{(t)} for the current parameters.

E-step. Fix θold\theta^{\text{old}} and maximize L\mathcal L over qq. Since log⁡p(X∣θold)\log p(X \mid \theta^{\text{old}}) does not depend on qq, this is the same as minimizing the KL term, and the answer is the posterior:

q(t+1)(Z)=p(Z∣X,θold)=p(X,Z∣θold)∑Z′p(X,Z′∣θold).q^{(t+1)}(Z) = p(Z \mid X, \theta^{\text{old}}) = \frac{p(X, Z \mid \theta^{\text{old}})}{\sum_{Z'} p(X, Z' \mid \theta^{\text{old}})}.

After this step the bound touches the likelihood at θold\theta^{\text{old}}.

M-step. Fix q(t+1)q^{(t+1)} and maximize L\mathcal L over θ\theta. The entropy H(q(t+1))H(q^{(t+1)}) is now a constant, so only the expected complete-data log-likelihood matters. It is called the Q-function:

Q(θ∣θold)=EZ∼p(Z∣X, θold)[log⁡p(X,Z∣θ)],θ(t+1)=arg⁡max⁡θQ(θ∣θold).Q(\theta \mid \theta^{\text{old}}) = \mathbb E_{Z \sim p(Z \mid X,\, \theta^{\text{old}})}\big[\log p(X, Z \mid \theta)\big], \qquad \theta^{(t+1)} = \arg\max_\theta Q(\theta \mid \theta^{\text{old}}).

Keep the two arguments apart. The distribution we average over is computed once, with the old parameters, and stays frozen. The logarithm inside contains the new parameters, the ones we optimize. That separation is what makes the M-step easy: we maximize a weighted complete-data log-likelihood, not a log of a sum.

Two remarks. The E-step does not sample ZZ: it computes a distribution, or just the expectations that QQ needs. And the M-step need not have a closed form: in some models it is a numerical optimization, for example a few gradient steps of a logistic regression.

EM for a Gaussian mixture

For a mixture, log⁡p(X,Z∣θ)\log p(X, Z \mid \theta) is a sum of terms [zi=k] (log⁡πk+log⁡N(xi∣μk,σk2))[z_i = k]\,\big(\log \pi_k + \log \mathcal N(x_i \mid \mu_k, \sigma_k^2)\big), where [zi=k][z_i = k] is 1 when zi=kz_i = k and 0 otherwise. The expectation of the indicator is the posterior probability of that component.

E-step: responsibilities. With the old parameters,

rik=p(zi=k∣xi,θold)=πk N(xi∣μk,σk2)∑j=1Kπj N(xi∣μj,σj2).r_{ik} = p(z_i = k \mid x_i, \theta^{\text{old}}) = \frac{\pi_k\, \mathcal N(x_i \mid \mu_k, \sigma_k^2)}{\sum_{j=1}^{K} \pi_j\, \mathcal N(x_i \mid \mu_j, \sigma_j^2)}.

Each row sums to one: ∑krik=1\sum_k r_{ik} = 1. These are soft assignments: a point may belong to one component with probability 0.70.7 and to the other with 0.30.3. Then

Q(θ∣θold)=∑i=1n∑k=1Krik [log⁡πk+log⁡N(xi∣μk,σk2)].Q(\theta \mid \theta^{\text{old}}) = \sum_{i=1}^{n} \sum_{k=1}^{K} r_{ik}\, \Big[\log \pi_k + \log \mathcal N(x_i \mid \mu_k, \sigma_k^2)\Big].

M-step: weighted ML estimates. Let Nk=∑irikN_k = \sum_i r_{ik} be the effective number of points in component kk. Maximizing QQ (with a Lagrange multiplier for ∑kπk=1\sum_k \pi_k = 1) gives

πknew=Nkn,μknew=1Nk∑i=1nrik xi,(σk2)new=1Nk∑i=1nrik (xi−μknew)2.\pi_k^{\text{new}} = \frac{N_k}{n}, \qquad \mu_k^{\text{new}} = \frac{1}{N_k} \sum_{i=1}^{n} r_{ik}\, x_i, \qquad (\sigma_k^2)^{\text{new}} = \frac{1}{N_k} \sum_{i=1}^{n} r_{ik}\, (x_i - \mu_k^{\text{new}})^2.

These are the ML estimates from the case of known labels, with every point counted with weight rikr_{ik}. The variance divides by NkN_k, not Nk−1N_k - 1: it is an ML estimate. In DD dimensions the last formula becomes a weighted covariance 1Nk∑irik(xi−μk)(xi−μk)⊤\frac{1}{N_k}\sum_i r_{ik} (x_i - \mu_k)(x_i - \mu_k)^\top.

First iteration on the running example. At θ(0)=(0.5,0,1)\theta^{(0)} = (0.5, 0, 1) the responsibilities of the first component are

xix_i −0.8-0.8 −0.2-0.2 0.30.3 0.90.9 2.12.1 2.82.8 3.43.4
ri1r_{i1} 0.7860.786 0.6680.668 0.5500.550 0.4010.401 0.1680.168 0.0910.091 0.0520.052

and ri2=1−ri1r_{i2} = 1 - r_{i1}. So N1=2.716N_1 = 2.716 and N2=4.284N_2 = 4.284. The new weight is π(1)=2.716/7=0.388\pi^{(1)} = 2.716 / 7 = 0.388, and the new first mean is μ1(1)=∑iri1xi/N1=0.549/2.716=0.202\mu_1^{(1)} = \sum_i r_{i1} x_i / N_1 = 0.549 / 2.716 = 0.202. The variances stay fixed at one in this model.

Why the likelihood never decreases

Why does EM never make the likelihood worse? Three facts, chained:

ℓ(θ(t+1))  ≥  L(q(t+1),θ(t+1))  ≥  L(q(t+1),θ(t))  =  ℓ(θ(t)).\ell(\theta^{(t+1)}) \;\ge\; \mathcal L(q^{(t+1)}, \theta^{(t+1)}) \;\ge\; \mathcal L(q^{(t+1)}, \theta^{(t)}) \;=\; \ell(\theta^{(t)}).

The first inequality holds because the ELBO is a lower bound at any θ\theta. The second is the M-step: it does not decrease L\mathcal L in θ\theta. The equality is the E-step: with the exact posterior the gap is zero at the old parameters.

On the running example the log-likelihood goes −14.69-14.69, −12.57-12.57, −12.21-12.21, −12.07-12.07, −12.00-12.00, … and settles at −11.946-11.946. After the first step θ(1)=(0.388, 0.202, 1.856)\theta^{(1)} = (0.388,\ 0.202,\ 1.856); at convergence θ=(0.568, 0.134, 2.632)\theta = (0.568,\ 0.134,\ 2.632): one component near zero, one near 2.62.6.

What the chain does not promise:

  • A global maximum. EM climbs to a stationary point, and different starts may reach different ones. Restarting from several initializations is standard.
  • Convergence of the parameters. Monotone and bounded values converge; the parameters themselves need extra conditions. Near a flat optimum EM can be very slow.
  • A finite maximum. With free variances, put one component on a single data point and let σk→0\sigma_k \to 0: its density at that point grows without bound, and so does ℓ\ell. In practice the variances are floored or given a prior.

Three useful relaxations keep part of the guarantee:

  • Generalized EM. If the E-step is exact, the M-step only has to increase QQ, for example by a few gradient steps. The chain still holds.
  • MAP-EM. Add log⁡p(θ)\log p(\theta) to QQ. The same argument shows that log⁡p(X∣θ)+log⁡p(θ)\log p(X \mid \theta) + \log p(\theta), the unnormalized log-posterior, never decreases.
  • Variational EM. If the exact posterior is out of reach, the E-step picks the best qq in a restricted family. The gap no longer closes, so only the ELBO is guaranteed to grow; the likelihood itself may go down.

EM does not require the complete-data distribution to be in the exponential family. That family only makes the M-step convenient.

Probabilistic PCA

Mixtures have a discrete latent variable. Now let it be continuous. Probabilistic PCA (PPCA) describes data xi∈RDx_i \in \mathbb R^D through a few hidden coordinates zi∈Rdz_i \in \mathbb R^d, d<Dd < D:

zi∼N(0,Id),xi=μ+Wzi+εi,εi∼N(0,σ2ID).z_i \sim \mathcal N(0, I_d), \qquad x_i = \mu + W z_i + \varepsilon_i, \qquad \varepsilon_i \sim \mathcal N(0, \sigma^2 I_D).

The loadings matrix W∈RD×dW \in \mathbb R^{D \times d} has one column per latent direction; σ2\sigma^2 is isotropic noise. Everything is Gaussian and linear, so ziz_i integrates out in closed form. Means add, and covariances of independent terms add:

xi∼N(μ,C),C=WW⊤+σ2ID.x_i \sim \mathcal N(\mu, C), \qquad C = W W^\top + \sigma^2 I_D.

The ML solution. The mean is μ=xˉ\mu = \bar x. Centre the data, yi=xi−xˉy_i = x_i - \bar x, and diagonalize the sample covariance S=1n∑iyiyi⊤=Udiag⁡(λ1,…,λD) U⊤S = \frac1n \sum_i y_i y_i^\top = U \operatorname{diag}(\lambda_1, \dots, \lambda_D)\, U^\top with λ1≥⋯≥λD\lambda_1 \ge \dots \ge \lambda_D. Let UdU_d hold the first dd eigenvectors and Λd=diag⁡(λ1,…,λd)\Lambda_d = \operatorname{diag}(\lambda_1, \dots, \lambda_d). Then

σ2=1D−d∑j=d+1Dλj,W=Ud (Λd−σ2Id)1/2R,\sigma^2 = \frac{1}{D - d} \sum_{j = d+1}^{D} \lambda_j, \qquad W = U_d\, (\Lambda_d - \sigma^2 I_d)^{1/2} R,

where RR is any orthogonal d×dd \times d matrix. Along a kept eigenvector the model variance is ∥wj∥2+σ2\lVert w_j \rVert^2 + \sigma^2, and ML matches it to λj\lambda_j. In the other directions only noise is left, so σ2\sigma^2 is the average variance that the latent coordinates do not explain. The rotation RR is free because WR (WR)⊤=WW⊤WR\,(WR)^\top = WW^\top: rotating the latent coordinates does not change the distribution of xx. The column space is the PCA subspace. If all discarded eigenvalues are zero, no maximum with σ2>0\sigma^2 > 0 exists.

Example. Ten-dimensional data from the owner's note, n=100n = 100, drawn with a few strong latent directions and noise variance 11. The eigenvalues of SS are

62.23, 12.00, 4.45, 1.52, 1.35, 1.18, 0.89, 0.84, 0.63, 0.39.62.23,\ 12.00,\ 4.45,\ 1.52,\ 1.35,\ 1.18,\ 0.89,\ 0.84,\ 0.63,\ 0.39.

With d=3d = 3: σ2=6.80/7=0.971\sigma^2 = 6.80 / 7 = 0.971, and the columns have lengths λj−σ2=7.83, 3.32, 1.87\sqrt{\lambda_j - \sigma^2} = 7.83,\ 3.32,\ 1.87. The maximized log-likelihood for each dd:

dd 1 2 3 4 5 6 7 8 9
ℓ\ell −2052.6-2052.6 −1886.1-1886.1 −1814.2-1814.2 −1807.0-1807.0 −1800.1-1800.1 −1793.6-1793.6 −1791.1-1791.1 −1786.7-1786.7 −1783.9-1783.9

The gains are large up to d=3d = 3, then small, but never negative. At d=9d = 9 the extra columns soak up noise and σ2\sigma^2 drops to 0.390.39, well below the true 11. Maximum likelihood cannot choose dd.

EM for probabilistic PCA

The closed form needs the D×DD \times D matrix SS and its eigenvectors. EM avoids both: it costs O(nDd)O(nDd) per iteration, handles missing coordinates by averaging over them, and is the base for Bayesian PCA. Work with centred data yiy_i, so μ\mu is fixed and θ=(W,σ2)\theta = (W, \sigma^2).

E-step. All parameters on the right are old. Collect the terms in ziz_i in the exponent of p(yi∣zi) p(zi)p(y_i \mid z_i)\,p(z_i):

−12 zi⊤(Id+σ−2W⊤W) zi+σ−2 zi⊤W⊤yi+const.-\tfrac12\, z_i^\top \big(I_d + \sigma^{-2} W^\top W\big)\, z_i + \sigma^{-2}\, z_i^\top W^\top y_i + \text{const}.

This is a Gaussian in ziz_i with precision Id+σ−2W⊤WI_d + \sigma^{-2} W^\top W. With M=W⊤W+σ2IdM = W^\top W + \sigma^2 I_d, a d×dd \times d matrix,

p(zi∣yi,θold)=N(mi,V),mi=M−1W⊤yi,V=σ2M−1.p(z_i \mid y_i, \theta^{\text{old}}) = \mathcal N(m_i, V), \qquad m_i = M^{-1} W^\top y_i, \qquad V = \sigma^2 M^{-1}.

The M-step needs two moments: E[zi]=mi\mathbb E[z_i] = m_i and E[zizi⊤]=V+mimi⊤\mathbb E[z_i z_i^\top] = V + m_i m_i^\top.

M-step. The expected complete-data log-likelihood is

Q(W,σ2)=−nD2log⁡σ2−12σ2∑i=1n[∥yi∥2−2 yi⊤Wmi+tr⁡ ⁣(W⊤W E[zizi⊤])]+const.Q(W, \sigma^2) = -\frac{nD}{2} \log \sigma^2 - \frac{1}{2\sigma^2} \sum_{i=1}^{n} \Big[ \lVert y_i \rVert^2 - 2\, y_i^\top W m_i + \operatorname{tr}\!\big(W^\top W\, \mathbb E[z_i z_i^\top]\big) \Big] + \text{const}.

Setting the derivatives to zero gives

Wnew=(∑iyi mi⊤)(∑iE[zizi⊤])−1,W^{\text{new}} = \Big(\sum_{i} y_i\, m_i^\top\Big) \Big(\sum_{i} \mathbb E[z_i z_i^\top]\Big)^{-1}, (σ2)new=1nD∑i[∥yi∥2−2 yi⊤Wnewmi+tr⁡ ⁣((Wnew)⊤Wnew E[zizi⊤])].(\sigma^2)^{\text{new}} = \frac{1}{nD} \sum_{i} \Big[ \lVert y_i \rVert^2 - 2\, y_i^\top W^{\text{new}} m_i + \operatorname{tr}\!\big((W^{\text{new}})^\top W^{\text{new}}\, \mathbb E[z_i z_i^\top]\big) \Big].

The first is a least-squares regression of yy on zz, with the inputs known only up to their posterior. The moments mim_i, E[zizi⊤]\mathbb E[z_i z_i^\top] come from the old parameters; the σ2\sigma^2 update already uses the new WW. Why nDnD here and D−dD - d in the closed form? Here we average expected squared residuals over all nDnD coordinates; the closed form appears only after WW is eliminated at the joint optimum. At that optimum the two agree.

Bayesian PCA

PPCA by maximum likelihood cannot pick dd. The topic The relevance vector machine already solved a similar problem for regression weights: give each one its own precision and let the evidence switch the useless ones off. Bayesian PCA does the same for whole columns of WW:

p(W∣α)=∏j=1dN(wj∣0, αj−1ID).p(W \mid \alpha) = \prod_{j=1}^{d} \mathcal N\big(w_j \mid 0,\ \alpha_j^{-1} I_D\big).

Start with d=D−1d = D - 1 columns; that is enough to represent any covariance. A large αj\alpha_j pulls column wjw_j to zero and deletes latent direction jj.

Training alternates two steps.

Step 1: MAP-EM for WW and σ2\sigma^2 with α\alpha fixed. The E-step is unchanged. Write A=diag⁡(α1,…,αd)A = \operatorname{diag}(\alpha_1, \dots, \alpha_d), G=∑iyimi⊤G = \sum_i y_i m_i^\top and H=∑iE[zizi⊤]H = \sum_i \mathbb E[z_i z_i^\top]. The prior adds −12tr⁡(WAW⊤)-\frac12 \operatorname{tr}(W A W^\top) to QQ, and the M-step for WW becomes

Wnew=G (H+σ2A)−1.W^{\text{new}} = G\, \big(H + \sigma^2 A\big)^{-1}.

With A=0A = 0 this is EM for PPCA.

Step 2: precisions with WW fixed. Update each αj\alpha_j as in the RVM, now for a column of DD numbers: αj=D/∥wj∥2\alpha_j = D / \lVert w_j \rVert^2.

The α\alpha update plugs in a point estimate of WW instead of integrating it out, so it only approximates evidence maximization.

Which directions survive. Take a column along an eigenvector of SS with eigenvalue λ\lambda, and let u=∥wj∥2u = \lVert w_j \rVert^2. At a fixed point of both steps,

(n+D) u2−[n(λ−σ2)−2Dσ2] u+Dσ4=0.(n + D)\, u^2 - \big[n(\lambda - \sigma^2) - 2D\sigma^2\big]\, u + D\sigma^4 = 0.

A positive root exists only when the discriminant is non-negative and the linear coefficient has the right sign, which works out to

λσ2  ≥  1+2(D+D(n+D))n.\frac{\lambda}{\sigma^2} \;\ge\; 1 + \frac{2\big(D + \sqrt{D(n + D)}\big)}{n}.

Maximum likelihood keeps a direction whenever λ>σ2\lambda > \sigma^2. The prior demands extra evidence, about 2D/n2\sqrt{D/n} in relative terms when n≫Dn \gg D. Below the threshold the only fixed point is wj=0w_j = 0 with αj=∞\alpha_j = \infty.

On the ten-dimensional example (n=100n = 100, D=10D = 10, nine columns at the start) the threshold is 1.8631.863. EM settles at σ2=0.978\sigma^2 = 0.978, close to the true 11, so directions with λ<1.82\lambda < 1.82 are pruned. Three columns survive, with lengths 7.45, 3.14, 1.727.45,\ 3.14,\ 1.72 and precisions α=(0.180, 1.017, 3.391)\alpha = (0.180,\ 1.017,\ 3.391). The ML lengths were 7.83, 3.32, 1.877.83,\ 3.32,\ 1.87: the prior also shrinks what it keeps.

Every step of this topic leaned on one thing: the exact posterior p(Z∣X,θ)p(Z \mid X, \theta) in the E-step. A fully Bayesian PCA would also put a posterior on WW, and then ziz_i and WW enter the likelihood as a product WziW z_i: the joint posterior has no closed form. When the E-step cannot be exact, we choose qq from a tractable family and maximize the ELBO over it. That is the next topic, Variational inference.

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Full notes

Answers are saved on the server and tied to this browser until you sign in.