EM update for a single-factor Gaussian model (source code)

= EM update for a single-factor Gaussian model
{c}

In <factor analysis> with one factor and fixed noise variance $v>0$, let $\lambda$ be the current loading vector, $s=v+|\lambda|^2$, and $S=n^{-1}\sum_iY_iY_i^T$. The <expectation-maximization algorithm> update is
$$
\lambda_{\mathrm{new}}=\frac{sS\lambda}{vs+\lambda^TS\lambda}.
$$
The conditional factor means are $\lambda^TY_i/s$ and their variances are $v/s$; maximizing the expected complete-data log-likelihood gives the formula.