Why Use EM for Gaussian Factor Analysis?
In a Gaussian factor model, the observed variables are related through latent factors, while each observed variable also has its own specific error. The likelihood is therefore built from a covariance matrix of the form \(\Lambda\Lambda^\mathsf{T}+\Psi\). Direct likelihood optimization can be difficult because the factors are unobserved. The expectation-maximization (EM) algorithm handles this by alternating between estimating the conditional distribution of the factors and maximizing an expected complete-data log-likelihood.
The latent-factor representation makes both steps explicit. In the E-step, the current parameters give the conditional means and covariances of the factors given the observations. In the M-step, those conditional moments act like sufficient statistics for updating the loadings and uniquenesses. The mean deserves particular care: if it is unknown, its EM update is generally not just the observed sample mean.
The E-Step: Conditional Factor Moments
Write the current parameter values as \(\mu,\Lambda,\Psi\), and let \(x_i\) denote the observed value of \(X_i\). Completing the square in the joint Gaussian density of \(Z_i\) and \(X_i\) gives the conditional distribution of the factor:
The E-step needs the first and second conditional moments. They are \(E[Z_i\mid x_i]=m_i\) and \(E[Z_iZ_i^\mathsf{T}\mid x_i]=V+m_im_i^\mathsf{T}\). The second identity follows by writing \(Z_i=(Z_i-m_i)+m_i\): the centered conditional term has covariance \(V\), and its conditional mean is zero.
Worked Example: One Posterior Factor Distribution
Take \(p=2\), \(q=1\), \(\mu=(0,0)^\mathsf{T}\), \(\Lambda=(1,0.5)^\mathsf{T}\), and \(\Psi=I_2\). For an observation \(x=(1,2)^\mathsf{T}\), calculate the conditional factor moments.
The scalar conditional variance is \(V=(1+\Lambda^\mathsf{T}\Psi^{-1}\Lambda)^{-1}=(1+1^2+0.5^2)^{-1}=4/9\). The conditional mean is \(m=V\Lambda^\mathsf{T}x=(4/9)(1+0.5(2))=8/9\).
Consequently, \(E[Z\mid x]=8/9\), while \(E[Z^2\mid x]=V+m^2=4/9+64/81=100/81\). The second moment is not the square of the conditional mean: it includes the remaining conditional uncertainty \(V\).
The M-Step: Loadings, Mean, and Uniquenesses
Let \(m_i\) and \(V\) be the E-step quantities computed at the current parameters. Define the average observed vector and average conditional factor mean by \(\bar x=n^{-1}\sum_i x_i\) and \(\bar m=n^{-1}\sum_i m_i\). The following centered expected moments are useful:
Here \(A\) is \(q\times q\) and \(B\) is \(p\times q\). In the ordinary unconstrained M-step, the updates are \(\Lambda_{\mathrm{new}}=BA^{-1}\) and \(\mu_{\mathrm{new}}=\bar x-\Lambda_{\mathrm{new}}\bar m\). Since \(V\) is positive definite under the stated assumptions, \(A\) is positive definite and its inverse exists.
To derive the loading and mean updates, retain the terms in the expected complete-data log-likelihood that depend on them. Apart from constants, these terms are minus one half the sum of the expected squared residuals weighted by \(\Psi^{-1}\). Because \(\Psi\) is diagonal, each observed-variable row minimizes its own expected squared residual. For a proposed \(\mu\), the rowwise least-squares normal equations give \(\Lambda=\{\sum_i(x_i-\mu)m_i^\mathsf{T}\}\{\sum_i E[Z_iZ_i^\mathsf{T}\mid x_i]\}^{-1}\). Equivalently, this is least squares with an intercept: subtract the sample averages of the observed vectors and the conditional factor means. The centered normal equations become \(\Lambda_{\mathrm{new}}A=B\), so \(\Lambda_{\mathrm{new}}=BA^{-1}\). The intercept equation is \(\mu_{\mathrm{new}}=\bar x-\Lambda_{\mathrm{new}}\bar m\). This establishes the joint updates rather than treating the mean as fixed during the loading maximization.
For the uniqueness update, let \(S_j=\sum_i E[(x_{ij}-\mu_j-\lambda_j^\mathsf{T}Z_i)^2\mid x_i]\). The part of the auxiliary function involving \(\psi_j\) is \(-\frac{n}{2}\log\psi_j-\frac{S_j}{2\psi_j}\). If \(S_j>0\), differentiating with respect to \(\psi_j>0\) and setting the derivative to zero gives the maximizer \(\psi_{j,\mathrm{new}}=S_j/n\). If \(S_j=0\), the auxiliary function increases without bound as \(\psi_j\) approaches zero, so there is no maximum over \(\psi_j>0\); a positive lower bound or another boundary treatment is needed. In computation, each expectation can be evaluated as \[ (x_{ij}-\mu_j-\lambda_j^\mathsf{T}m_i)^2+\lambda_j^\mathsf{T}V\lambda_j. \] The first term is the squared residual at the conditional factor mean; the second accounts for conditional factor uncertainty.
Worked Example: One Complete EM Iteration
Use three observations \(x_1=(1,0)^\mathsf{T}\), \(x_2=(0,1)^\mathsf{T}\), and \(x_3=(-1,-1)^\mathsf{T}\). Start with \(\mu=(0,0)^\mathsf{T}\), \(\Lambda=(1,0.5)^\mathsf{T}\), and \(\Psi=I_2\). There is one factor, so all factor moments below are scalars.
The E-step variance remains \(V=4/9\). The conditional factor means are \(m_1=4/9\), \(m_2=2/9\), and \(m_3=-2/3\), obtained from \(m_i=(4/9)(x_{i1}+0.5x_{i2})\). Their average is \(\bar m=0\), and \(\bar x=(0,0)^\mathsf{T}\).
The centered factor second moment is \(A=4/9+\{(4/9)^2+(2/9)^2+(-2/3)^2\}/3 =108/243+56/243=164/243\). The cross-moment vector is \(B=(10/27,8/27)^\mathsf{T}\): its first entry is \(\{1(4/9)+0(2/9)+(-1)(-2/3)\}/3=10/27\), and its second is \(\{0(4/9)+1(2/9)+(-1)(-2/3)\}/3=8/27\). Thus \(\Lambda_{\mathrm{new}}=BA^{-1}=(45/82,18/41)^\mathsf{T}\), and \(\mu_{\mathrm{new}}=\bar x-\Lambda_{\mathrm{new}}\bar m=(0,0)^\mathsf{T}\).
For each observed variable, the sample mean square about zero is \(2/3\). The residual update can be written \(2/3-B_j^2/A\), since the loading update is the least-squares solution. For variable 1, \(2/3-(10/27)^2/(164/243)=2/3-25/123=19/41\). For variable 2, \(2/3-(8/27)^2/(164/243)=2/3-16/123=22/41\). Therefore \(\Psi_{\mathrm{new}}=\operatorname{diag}(19/41,22/41)\), and both updated uniquenesses are positive.
Why the Unknown-Mean Update Matters
The observed-data Gaussian likelihood separates into a mean component and a covariance component. This means that its maximum-likelihood estimate of the mean is \(\bar x\). But this fact does not make \(\bar x\) the general mean update in the EM M-step: the M-step maximizes the expected complete-data log-likelihood using the factor moments from the current E-step. The loading update and mean update must be compatible with those moments.
Worked Example: Checking the Mean Update
Consider the scalar model with \(n=2\), observations \(x_1=1,x_2=2\), and current values \(\mu=0,\lambda=1,\psi=1\). The E-step gives \(V=1/2\), \(m_1=1/2\), and \(m_2=1\), so \(\bar x=3/2\) and \(\bar m=3/4\).
The centered moments are \(A=1/2+\{(-1/4)^2+(1/4)^2\}/2=9/16\) and \(B=\{(-1/2)(-1/4)+(1/2)(1/4)\}/2=1/8\). Hence \(\lambda_{\mathrm{new}}=(1/8)/(9/16)=2/9\), and the EM mean update is \(\mu_{\mathrm{new}}=3/2-(2/9)(3/4)=4/3\), not \(3/2\).
The uniqueness update is also directly checkable. The observed centered mean square is \(1/4\), so \(\psi_{\mathrm{new}}=1/4-B^2/A=1/4-1/36=2/9\). This example distinguishes the observed-data mean estimate from the mean that maximizes the EM auxiliary function at this iteration.
A convenient alternative is to center the data at \(\bar x\) before fitting the covariance model, then fix the mean at zero during EM. This uses the separation of the observed Gaussian likelihood into mean and covariance components. It is a different parameterization of the fitting calculation; it should not be confused with claiming that the unrestricted EM mean update equals \(\bar x\) at every iteration.
Likelihood Monotonicity and a Practical Pitfall
An exact EM iteration cannot decrease the observed-data likelihood, provided the E-step uses the current conditional distribution and the M-step does not decrease the auxiliary function. For this Gaussian model with positive definite \(\Psi\), the relevant densities and conditional expectations are well-defined. To see the likelihood argument, let \(q_i(z)\) be the old conditional density of \(Z_i\) given \(x_i\), and let \(p_\theta(x_i,z)\) be the joint density under parameter \(\theta\). The identity \[ \ell(\theta)-\ell(\theta_{\mathrm{old}}) =Q(\theta\mid\theta_{\mathrm{old}})-Q(\theta_{\mathrm{old}}\mid\theta_{\mathrm{old}}) +\sum_i \operatorname{KL}\!\left(q_i\,\middle\|\,p_\theta(\,\cdot\mid x_i)\right) \] follows by substituting the conditional-density identity \(p_\theta(z\mid x_i)=p_\theta(x_i,z)/p_\theta(x_i)\) into the definition of each Kullback–Leibler divergence. The divergence is nonnegative: for densities \(q,r\), Jensen's inequality gives \(E_q[\log(r/q)]\leq \log E_q[r/q]\leq 0\), so \(E_q[\log(q/r)]\geq0\). Thus an M-step that increases \(Q\) also does not decrease \(\ell\). Equality can occur, for example, at a stationary point. \(\square\)
- Common mistake: setting \(\mu_{\mathrm{new}}=\bar x\) automatically in the unrestricted EM M-step. That uses the observed-data mean estimate instead of maximizing the current auxiliary function jointly over \(\mu\) and \(\Lambda\). The correction is \(\mu_{\mathrm{new}}=\bar x-\Lambda_{\mathrm{new}}\bar m\), or to center the data and explicitly fix the mean at zero.
- Another common mistake: using \(m_im_i^\mathsf{T}\) as the conditional second moment. The correct quantity is \(V+m_im_i^\mathsf{T}\); omitting \(V\) discards uncertainty about the unobserved factors.
- Numerical caution: the updates are for a specified factor dimension and a diagonal, positive uniqueness matrix. Check that the resulting uniqueness estimates are admissible and monitor convergence; rotational nonuniqueness of the loading representation is not removed by these EM formulas.
Check Your Understanding
Use the model and update equations above to answer these questions.
- Why does the conditional second moment \(E[Z_iZ_i^\mathsf{T}\mid x_i]\) contain both \(V\) and \(m_im_i^\mathsf{T}\)?
- In the unrestricted M-step, what relationship connects \(\mu_{\mathrm{new}}\), \(\bar x\), \(\Lambda_{\mathrm{new}}\), and \(\bar m\)?
- What assumptions allow the loading normal equations to separate into rowwise least-squares problems?
- Explain why using the sample mean as the unrestricted EM mean update can be incorrect, even though it is the observed-data maximum-likelihood estimate.
- What does the conditional-uncertainty term \(\lambda_j^\mathsf{T}V\lambda_j\) contribute to the uniqueness update?