Tutorials › Multi-Omics Data Integration › Expectation-Maximization For Multi-Omics Factors

Latent Factor Models and Their Interpretation · Tutorial 230 of 597

Expectation-Maximization For Multi-Omics Factors

Learn to derive the E-step and M-step for a shared Gaussian multi-omics factor model, calculate their updates, and recognize assumptions and failure modes.

Advanced 11 min read

What You'll Learn

  • State the Gaussian shared-factor model and its conditional independence assumptions.
  • Derive posterior means and second moments of sample-level latent scores.
  • Update feature loadings and residual variances from the E-step expectations.
  • Work through numerical E-step and M-step calculations.
  • Explain why EM does not guarantee a globally optimal or uniquely oriented factor solution.
  • Identify missing-data, residual-model, and initialization pitfalls.

Why Expectation-Maximization Is Used

In a multi-omics factor model, the latent scores are not observed, but they explain dependence among measured features across omics views. If those scores were known, estimating loadings and residual variances would be relatively direct. If the parameters were known, estimating the scores would also be direct. The expectation-maximization (EM) algorithm alternates between these two calculations: it uses the current parameters to find conditional expectations of the latent scores, then uses those expectations to update the parameters.

This tutorial derives EM for a Gaussian model with shared factors, observed measurements, and feature-specific residual variances. The model is deliberately stated precisely: the validity of the updates depends on its distributional and independence assumptions. The method is an estimation procedure, not a way to establish that a fitted factor represents a biological mechanism.

Model and Assumptions

Suppose \(n\) samples have measurements in \(V\) omics views. View \(v\) contains \(p_v\) features, and there are \(K\) shared factors. Let \(y_{ivj}\) be the measurement for sample \(i\), view \(v\), and feature \(j\); let \(z_i\) be the \(K\)-dimensional latent score for sample \(i\); let \(\lambda_{vj}\) be the loading vector for that feature; and let \(\mu_{vj}\) be its mean.

Assume measurements are centered in advance or that the means \(\mu_{vj}\) are fixed at known values. Write \(y_i\) for the concatenated, mean-centered measurement vector across all views for sample \(i\), and \(\Lambda\) for the corresponding matrix of loading rows. The residual covariance matrix \(\Psi\) is diagonal: its entry for feature \(j\) in view \(v\) is \(\psi_{vj}>0\).

Model: For each independent sample \(i\), \(z_i\sim N(0,I_K)\), and \(y_i=\Lambda z_i+\epsilon_i\), where \(\epsilon_i\sim N(0,\Psi)\). The scores and residuals are independent. Thus, conditional on \(z_i\), all observed features are independent, with feature-specific residual variances. The number of factors \(K\) is fixed, all measurements used in the likelihood are observed, and the model parameters are shared across samples.

The standard normal score distribution fixes a scale for the latent scores, but it does not generally fix their orientation: rotations of the factors can leave the implied covariance unchanged. This is the rotational ambiguity covered in the earlier material on rotational invariance. An EM fit therefore need not yield a uniquely oriented loading matrix. Further interpretation may require constraints or an alignment convention.

The E-Step: Conditional Score Expectations

Let the current loading and residual parameters be \(\Lambda\) and \(\Psi\). The E-step finds the conditional distribution of \(z_i\) given \(y_i\) under these current parameters. Define \(C=(I_K+\Lambda^\mathsf{T}\Psi^{-1}\Lambda)^{-1}\) and \(m_i=C\Lambda^\mathsf{T}\Psi^{-1}y_i\). Then the posterior distribution is Gaussian:

$$ z_i\mid y_i \sim N(m_i,C),\qquad E[z_i\mid y_i]=m_i,\qquad E[z_i z_i^\mathsf{T}\mid y_i]=C+m_i m_i^\mathsf{T}. $$

The second moment is essential. It is not just \(m_i m_i^\mathsf{T}\), because the conditional score remains uncertain; its covariance \(C\) contributes to the expectation of \(z_i z_i^\mathsf{T}\).

To justify these expressions, the joint density as a function of \(z_i\) has log-kernel \(-\tfrac12[z_i^\mathsf{T}z_i+(y_i-\Lambda z_i)^\mathsf{T}\Psi^{-1}(y_i-\Lambda z_i)]\). Collecting the quadratic and linear terms in \(z_i\) gives precision matrix \(C^{-1}=I_K+\Lambda^\mathsf{T}\Psi^{-1}\Lambda\) and linear coefficient \(\Lambda^\mathsf{T}\Psi^{-1}y_i\). Completing the square gives the stated mean and covariance. Finally, for a random vector with mean \(m_i\) and covariance \(C\), its second moment is \(C+m_i m_i^\mathsf{T}\).

Worked Example: Combining Two Omics Measurements in the E-Step

Consider one sample, one factor, and two measured features from different views. Let \(y_i=(2,1)^\mathsf{T}\), \(\lambda=(1,2)^\mathsf{T}\), and \(\Psi=\operatorname{diag}(1,4)\). Assume the measurements are centered and use the model above.

The posterior precision is \(1+\lambda^\mathsf{T}\Psi^{-1}\lambda =1+(1)(1)(1)+(2)(1/4)(2)=3\), so \(C=1/3\).

The posterior mean is \(m_i=C\lambda^\mathsf{T}\Psi^{-1}y_i =(1/3)[(1)(2)+(2)(1/4)(1)]=(1/3)(2.5)=0.8333\). The posterior second moment is \(E[z_i^2\mid y_i]=C+m_i^2=1/3+(5/6)^2=37/36=1.0278\).

Both views contribute to the posterior score, but the second feature is downweighted by its residual variance of 4. The calculation is conditional on the stated Gaussian model and current parameters; it does not demonstrate that the model adequately describes these hypothetical measurements.

The M-Step: Updating Loadings and Residual Variances

The M-step maximizes the expected complete-data log-likelihood, where the expectation is taken over the E-step distributions of the scores. For compactness, define \(S=\sum_{i=1}^n E[z_i z_i^\mathsf{T}\mid y_i]\). For feature \(j\), let \(y_{\cdot j}\) be its \(n\)-vector of centered measurements and let \(\lambda_j\) be its loading vector. The expected squared-error term for this feature is \(\sum_i E[(y_{ij}-\lambda_j^\mathsf{T}z_i)^2\mid y_i]\).

Differentiating that term with respect to \(\lambda_j\), setting the derivative to zero, and solving gives the loading update. Then maximizing with respect to the residual variance gives the average expected squared error:

$$ \lambda_j^{\text{new}} = S^{-1}\sum_{i=1}^n y_{ij}m_i, \qquad \psi_j^{\text{new}} = \frac{1}{n}\sum_{i=1}^n \left[ y_{ij}^2-2y_{ij}(\lambda_j^{\text{new}})^\mathsf{T}m_i +(\lambda_j^{\text{new}})^\mathsf{T} (C+m_i m_i^\mathsf{T})\lambda_j^{\text{new}} \right]. $$

Here \(C\) is common across samples under the stated model. Apply the updates separately to each feature, using its own measurements and loading row; each feature has its own residual variance. The formula for \(\psi_j^{\text{new}}\) is an expected residual sum of squares divided by \(n\), so it has the units of that feature squared. In view-indexed notation, these are the updates for each \(j\) in each view \(v\).

For the loading update, the expected squared-error expression, up to terms not involving \(\lambda_j\), is \(\sum_i[-2y_{ij}\lambda_j^\mathsf{T}m_i+\lambda_j^\mathsf{T}E[z_i z_i^\mathsf{T}\mid y_i]\lambda_j]\). Its gradient is \(-2\sum_i y_{ij}m_i+2S\lambda_j\). Setting this to zero yields the update when \(S\) is invertible. For the variance, the expected Gaussian log-likelihood terms involving \(\psi_j\) are \(-\tfrac{n}{2}\log\psi_j-\tfrac{1}{2\psi_j}\sum_i E[(y_{ij}-\lambda_j^\mathsf{T}z_i)^2\mid y_i]\). Differentiating and setting the derivative to zero gives the expected squared error divided by \(n\).

Worked Example: Updating One Loading and Its Residual Variance

Suppose the E-step for two samples and one factor gave \(m_1=1\), \(m_2=0.5\), and \(C_1=C_2=0.25\). For one centered feature, let \(y_{1j}=2\) and \(y_{2j}=0\). These are hypothetical summaries from an E-step; use them to calculate this feature’s M-step updates.

The sum of expected score squares is \(S=(0.25+1^2)+(0.25+0.5^2)=1.25+0.50=1.75\). The loading numerator is \(2(1)+0(0.5)=2\), so \(\lambda_j^{\text{new}}=2/1.75=1.1429\).

For the first sample, the expected squared residual is \(2^2-2(2)(1)(1.1429)+(1.25)(1.1429^2)\), approximately \(0.5714\). For the second sample it is \(0^2-2(0)(1.1429)(0.5)+(0.50)(1.1429^2)\), approximately \(0.6531\). Thus \(\psi_j^{\text{new}}=(0.5714+0.6531)/2=0.6122\), in squared units of the measured feature. The update includes uncertainty in the scores through \(C_i\); replacing each second moment with \(m_i^2\) would omit that uncertainty.

Why the Iteration Increases Likelihood

Let \(\theta\) denote all model parameters and let \(q(z)\) be the conditional distribution of the latent scores under the current parameter value \(\theta^{\text{old}}\). The observed-data log-likelihood can be expressed as \(\log p(y\mid\theta)=\mathcal{L}(q,\theta)+\mathrm{KL}(q\,\|\,p(z\mid y,\theta))\), where \(\mathcal{L}(q,\theta)=E_q[\log p(y,z\mid\theta)]-E_q[\log q(z)]\), and \(\mathrm{KL}\) is the nonnegative Kullback–Leibler divergence. For the E-step choice \(q=p(z\mid y,\theta^{\text{old}})\), this divergence is zero at the old parameters. The M-step maximizes \(\mathcal{L}(q,\theta)\), so:

$$ \log p(y\mid\theta^{\text{new}}) \ \geq\ \mathcal{L}(q,\theta^{\text{new}}) \ \geq\ \mathcal{L}(q,\theta^{\text{old}}) \ =\ \log p(y\mid\theta^{\text{old}}). $$

Therefore an exact EM iteration does not decrease the observed-data likelihood. This result does not imply convergence to the global maximum: the likelihood can have local optima, and different initializations can reach different solutions. Nor does it remove rotational ambiguity in the factor representation.

Worked Example: Checking a Residual-Variance Update

Suppose a hypothetical feature has two observed centered values, \(y_{1j}=1\) and \(y_{2j}=-1\). For an M-step calculation, let both conditional score means be zero, both conditional variances be \(0.5\), and the current loading be \(1\). Then each expected squared score is \(0.5\).

For sample 1, the expected squared residual is \(1^2-2(1)(1)(0)+1^2(0.5+0^2)=1.5\). For sample 2, it is \((-1)^2-2(-1)(1)(0)+1^2(0.5+0^2)=1.5\). The updated residual variance is \((1.5+1.5)/2=1.5\), in squared units of the feature. The positive contribution beyond the observed squared values reflects uncertainty about the latent scores under this E-step.

Diagnostics, Alternatives, and Limitations

EM is useful when the latent scores are missing variables in a likelihood model and the conditional score distribution has tractable moments. Its updates use all views jointly to estimate shared scores while keeping feature-specific residual variances. Compared with direct numerical maximization of the observed-data likelihood, EM often replaces one difficult optimization with simpler conditional-expectation and maximization steps. Direct optimization can be preferable when a desired constraint or model extension makes the M-step inconvenient, but it requires reliable handling of the observed likelihood and its gradients. Principal component analysis (PCA) is a different alternative: it gives a low-rank description of variation, but does not by itself provide this Gaussian latent-variable likelihood with feature-specific residual variances.

Check whether the observed-data log-likelihood is nondecreasing across exact EM iterations and whether fitted residual variances remain positive and plausible. A decrease may signal an incorrect update, numerical error, or an implementation that is not performing an exact M-step. Very small residual variances can make \(\Psi^{-1}\) unstable; a nearly singular \(S\) can make the loading update unstable. These issues may indicate inadequate data for the chosen factor count, problematic scaling, or numerical conditioning. They are not resolved just by continuing to iterate.

The assumptions also limit what this model can capture. Diagonal \(\Psi\) implies residual independence across features conditional on the scores; remaining structured dependence suggests that the model is missing structure or that the residual specification is inadequate. Gaussian errors may be inappropriate for counts or binary measurements, for which Gaussian updates do not apply. When some measurements are missing, the displayed formulas cannot simply be applied as though the missing entries were observed. Under an appropriate ignorable-missingness assumption, likelihood calculations can instead use each sample’s observed features, with corresponding posterior moments and updates; the exact observed-data pattern must be handled in both steps.

A common mistake is to use only \(m_i m_i^\mathsf{T}\) in the M-step and omit \(C\). That treats the estimated scores as known, even though they have conditional uncertainty. The correct second moment is \(C+m_i m_i^\mathsf{T}\); omitting \(C\) generally changes both loading and residual-variance updates. Another mistake is to treat likelihood increase as evidence that the factors are uniquely identified or biologically meaningful. EM guarantees neither: it optimizes within the specified model and may converge to a local solution with an orientation equivalent to other factor representations.

Key takeaway: In Gaussian shared-factor EM, the E-step supplies both \(E[z_i\mid y_i]\) and \(E[z_i z_i^\mathsf{T}\mid y_i]\). The M-step uses those moments to update each feature’s loadings and residual variance. The updates rely on the model assumptions and do not guarantee a global optimum or a unique factor orientation.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In one sentence, explain why \(E[z_i z_i^\mathsf{T}\mid y_i]\) is not generally equal to \(m_i m_i^\mathsf{T}\).
  2. For one factor, suppose \(C=0.2\) and \(m_i=0.6\). Calculate \(E[z_i^2\mid y_i]\).
  3. What assumption about \(\Psi\) makes residuals for different features conditionally independent in this model?
  4. Does a nondecreasing likelihood guarantee that EM has found the global maximum? Explain.
  5. Give one reason the Gaussian EM updates should not be used unchanged for binary measurements.

Solutions. (1) The conditional score has covariance \(C\), so its second moment includes that covariance: \(E[z_i z_i^\mathsf{T}\mid y_i]=C+m_i m_i^\mathsf{T}\). (2) \(E[z_i^2\mid y_i]=0.2+0.6^2=0.56\). (3) \(\Psi\) is diagonal, and the model assumes the residuals are independent of the scores and of one another. (4) No. EM’s likelihood is nondecreasing under exact steps, but it can converge to a local optimum. (5) Binary outcomes do not follow the Gaussian observation likelihood assumed in the derivation, so the Gaussian conditional moments and M-step formulas are not valid for that likelihood.

Clinical Biostats