Tutorials › Multi-Omics Data Integration › Bayesian Priors On Scores And Loadings

Latent Factor Models and Their Interpretation · Tutorial 232 of 597

Bayesian Priors On Scores And Loadings

Specify common priors for factor scores, loadings, and residual variances, and see how their scales affect posterior estimates and uncertainty.

Advanced 13 min read

What You'll Learn

  • Write a Gaussian multi-view factor model with priors for scores, loadings, and residual variances.
  • Derive a conditional normal posterior for a loading and for a sample score.
  • Update an inverse-gamma prior for a residual variance using observed residuals.
  • Explain how prior scale changes posterior shrinkage and uncertainty.
  • Check prior assumptions, scale compatibility, and sensitivity to alternative priors.
  • Distinguish ordinary continuous shrinkage priors from sparsity-inducing priors.

Why Put Priors on Factor Model Parameters?

A factor model represents each sample’s measurements through a smaller set of latent scores and feature loadings, plus residual variation. The likelihood describes how the observations relate to those quantities; priors describe plausible parameter values before observing the data. In a multi-omics analysis, priors can stabilize estimates when the number of features is large relative to the number of samples, encode a chosen scale, and express uncertainty rather than returning only a single fitted solution.

A prior is not a substitute for an appropriate likelihood or an identifiable parameterization. The earlier material on rotational invariance and scale constraints is important here: different combinations of scores and loadings can represent the same fitted signal. Isotropic normal priors can be invariant to orthogonal rotations, so they do not by themselves identify a unique orientation for the factors. Any constraints or conventions used to interpret factors must be stated separately.

Model and Common Prior Choices

For continuous measurements, let \(y_{ijv}\) denote the measurement for sample \(i\), feature \(j\), and omics view \(v\). A simple conditionally Gaussian factor model is

$$ y_{ijv} = \sum_{k=1}^{K} z_{ik}\lambda_{jkv}+\epsilon_{ijv}, \qquad \epsilon_{ijv}\sim N(0,\psi_{jv}). $$

Here \(z_{ik}\) is the score of sample \(i\) on factor \(k\), \(\lambda_{jkv}\) is the loading of feature \(j\) in view \(v\) on that factor, and \(\psi_{jv}\) is the residual variance for that feature and view. This specification assumes conditional independence of residuals across observations and features given the scores and loadings, and Gaussian residuals with mean zero. A common simplifying model instead uses one residual variance per view. These choices are modeling assumptions, not consequences of factor analysis.

Definition: A prior distribution assigns a probability distribution to an unknown parameter before conditioning on the observed data. The posterior distribution is proportional to the likelihood times the prior. A common baseline factor-model specification uses independent \(z_{ik}\sim N(0,1)\), independent \(\lambda_{jkv}\sim N(0,\tau_v^2)\), and independent \(\psi_{jv}\sim \operatorname{IG}(a_v,b_v)\), subject to any stated constraints. The inverse-gamma parameterization here has density proportional to \(\psi^{-a_v-1}\exp(-b_v/\psi)\) for \(\psi>0\).

The standard-normal score prior sets the factor-score scale and centers scores at zero. The loading prior is centered at zero and gives a typical loading magnitude set by \(\tau_v\). If measurements have been standardized, \(\tau_v\) is interpreted on that scale; if not, it must be chosen in the units of the measurements per unit score. A smaller \(\tau_v\) pulls loadings more strongly toward zero. The inverse-gamma prior is a convenient positive prior for a variance and yields a simple conditional update under Gaussian residuals. Its parameters \(a_v\) and \(b_v\) jointly determine its shape and scale; neither should be selected without considering the units and plausible residual magnitudes.

These priors are often chosen to make conditional posterior calculations tractable. Independence is a convenient baseline, not a universal scientific truth. For example, the same loading prior variance across features assumes comparable loading scales after preprocessing. If views have different measurement scales, view-specific prior scales or suitable preprocessing may be needed. A normal loading prior is generally a continuous shrinkage prior: it favors small values but assigns probability zero to an exactly zero loading. It is not a feature-selection prior.

How Normal Priors Produce Shrinkage

Consider one loading \(\lambda\), with known scores \(z_i\), a known residual variance \(\psi\), and observations \(y_i=z_i\lambda+\epsilon_i\). Suppose \(\epsilon_i\) are independent \(N(0,\psi)\) and the prior is \(\lambda\sim N(0,\tau^2)\). Multiplying the Gaussian likelihood by the normal prior gives a normal posterior. Completing the square in \(\lambda\) gives the posterior precision as prior precision plus data precision:

$$ \lambda\mid \mathbf{y},\mathbf{z},\psi \sim N(m,V),\qquad V=\left(\frac{1}{\tau^2}+\frac{\sum_i z_i^2}{\psi}\right)^{-1}, \qquad m=V\frac{\sum_i z_i y_i}{\psi}. $$

This expression makes the influence of the prior explicit. The posterior mean is a precision-weighted compromise between the prior mean, zero, and the data-supported estimate. When the data precision \(\sum_i z_i^2/\psi\) is large relative to \(1/\tau^2\), the posterior is driven more by the data. When it is small, the mean is pulled toward zero and the posterior variance is closer to the prior variance.

Worked Example: Updating a Loading

Suppose a single feature has two observations with known scores \(z_1=z_2=1\), residual variance \(\psi=1\) measurement unit squared, and observed values \(y_1=1.2\) and \(y_2=0.8\) measurement units. Use the prior \(\lambda\sim N(0,1)\), where the loading is measured in measurement units per unit score. The conditional Gaussian model assumes independent mean-zero residuals with variance 1; for this calculation, the scores and residual variance are treated as known.

The posterior variance and mean are

$$ V=\left(1+\frac{1^2+1^2}{1}\right)^{-1} =\frac{1}{3}=0.3333, \qquad m=\frac{1}{3}\frac{1(1.2)+1(0.8)}{1} =\frac{2}{3}=0.6667. $$

Thus \(\lambda\mid\mathbf{y},\mathbf{z},\psi\sim N(0.6667,0.3333)\). The data-only least-squares estimate is \((1.2+0.8)/2=1.0\) measurement unit per score. The posterior mean is closer to the prior mean of zero, reflecting the finite prior precision. The posterior standard deviation is \(\sqrt{0.3333}=0.5774\) measurement units per score.

Scores Also Have Posterior Distributions

A prior on scores makes uncertainty about sample positions in latent space explicit. For one sample with \(K=1\), suppose measurements from \(J\) features follow \(y_j=z\lambda_j+\epsilon_j\), with independent \(\epsilon_j\sim N(0,\psi_j)\), known loadings, and \(z\sim N(0,1)\). Completing the square gives

$$ z\mid\mathbf{y},\boldsymbol{\lambda},\boldsymbol{\psi} \sim N(m_z,V_z),\qquad V_z=\left(1+\sum_j\frac{\lambda_j^2}{\psi_j}\right)^{-1}, \qquad m_z=V_z\sum_j\frac{\lambda_j y_j}{\psi_j}. $$

The score posterior mean balances the prior value zero against evidence across features. Features with larger residual variance contribute less, while features whose loadings are informative relative to their residual noise contribute more. This is a conditional update: in a full Bayesian analysis, scores, loadings, and residual variances are uncertain jointly, and posterior computation must account for that uncertainty.

Worked Example: Updating a Sample Score Across Two Views

For one sample, suppose two standardized measurements are \(y_1=1.1\) and \(y_2=0.7\), with known loadings \(\lambda_1=1\) and \(\lambda_2=0.5\). Let both residual variances be 1, and use \(z\sim N(0,1)\). Assume the two residuals are conditionally independent and Gaussian, and treat loadings and variances as known for this update.

The posterior variance and mean are

$$ V_z=\left(1+\frac{1^2}{1}+\frac{0.5^2}{1}\right)^{-1} =\frac{1}{2.25}=0.4444, $$
$$ m_z=0.4444\left(\frac{1(1.1)}{1}+\frac{0.5(0.7)}{1}\right) =0.4444(1.45)=0.6444. $$

The conditional posterior is \(N(0.6444,0.4444)\) in score units. Both measurements support a positive score, but the estimate remains below the unregularized weighted least-squares value \(1.45/1.25=1.16\), because the prior contributes precision 1 centered at zero. The posterior standard deviation is \(0.6667\) score units.

Residual Variance Priors and Their Update

For a feature with \(n\) independent Gaussian residuals \(e_1,\ldots,e_n\), suppose \(e_i\mid\psi\sim N(0,\psi)\) and \(\psi\sim\operatorname{IG}(a,b)\). The likelihood contributes a factor \(\psi^{-n/2}\exp[-\sum_i e_i^2/(2\psi)]\). Multiplication by the inverse-gamma prior therefore gives

$$ \psi\mid\mathbf{e}\sim \operatorname{IG}\left(a+\frac{n}{2},\ b+\frac{1}{2}\sum_{i=1}^{n}e_i^2\right). $$

The posterior shape increases with the number of residual observations, and the scale increases with their sum of squares. This update assumes that the residuals are conditionally independent, have the stated common variance, and are centered at zero under the model. Residuals in a fitted factor model are not directly observed as fixed quantities; in a Bayesian analysis, this conditional update is used alongside uncertainty in scores and loadings rather than pretending those quantities are known.

Worked Example: Updating a Residual Variance

Suppose a feature has three hypothetical residuals, in standardized measurement units, of \(0.2\), \(-0.1\), and \(0.3\). For illustration, treat these residuals as known and conditionally independent Gaussian observations with common variance \(\psi\). Use the prior \(\psi\sim\operatorname{IG}(2,0.1)\), with \(b=0.1\) in standardized measurement units squared.

The residual sum of squares is \(0.2^2+(-0.1)^2+0.3^2=0.04+0.01+0.09=0.14\). Hence

$$ \psi\mid\mathbf{e}\sim \operatorname{IG}\left(2+\frac{3}{2},\ 0.1+\frac{0.14}{2}\right) =\operatorname{IG}(3.5,0.17). $$

Under this parameterization, when the shape exceeds 1 the inverse-gamma mean is \(b/(a-1)\). The posterior mean is therefore \(0.17/(3.5-1)=0.0680\) standardized measurement units squared. It is a posterior mean under the specified prior and residual model, not a claim that the variance is known to equal that value.

Prior Scale, Diagnostics, and Alternatives

Prior scales affect both posterior location and spread. A narrower loading prior usually produces stronger shrinkage toward zero and a smaller posterior variance when data are limited. A broader prior allows larger loadings and typically leaves more uncertainty. The same principle applies to score priors: changing their variance changes the regularization of sample scores and, together with loading scales, changes the model’s effective signal scale. For residual variance priors, changes in \(a\) and \(b\) affect the posterior, especially when there are few residual observations.

Check the implications of the priors before interpreting fitted factors. Useful checks include whether prior draws generate measurements in plausible ranges, whether their implied cross-feature or cross-view covariance is plausible, and whether conclusions change materially under reasonable alternative scales. Inspect posterior distributions for parameters pressed against regions where the prior has little support. Strong posterior sensitivity to modest prior changes is a warning that the data may not identify the parameter precisely. A prior predictive check draws parameters from the prior, then data from the likelihood, and asks whether the simulated data resemble plausible measurements.

A normal loading prior is a simple alternative to leaving loadings unregularized, as in maximum-likelihood fitting. Maximum likelihood can be useful for point estimation, but it does not by itself provide a posterior distribution or encode prior information. Variational inference approximates a posterior with a chosen family of distributions and can be computationally efficient; its uncertainty estimates depend on that approximation. A full Bayesian computation targets the posterior more directly but can be computationally demanding and remains sensitive to model and prior choices. None of these computational approaches repairs a misspecified likelihood or resolves rotational ambiguity automatically.

Common pitfall: “A zero-centered normal prior means the model has selected only the nonzero loadings.” This is incorrect: a continuous normal distribution assigns probability zero to any exact loading value, including zero, while merely concentrating more probability near zero. It shrinks estimates but does not perform exact feature selection. Also, a prior that is numerically broad on one measurement scale may be highly informative on another; prior scales must be interpreted in the units of the modeled data.

The assumptions and limitations should remain visible. Gaussian observation models may be unsuitable for counts or binary measurements, which require likelihoods appropriate to those data. Independent feature-level residual variances may fail when residual dependence remains. Independent normal priors do not encode known pathways, groups, or exact sparsity. Moreover, posterior summaries for individual factors can be hard to compare when sign, order, or rotation are not fixed: the fitted signal may be stable while a particular coordinate representation is not. Prior choice should therefore complement, not replace, explicit identification conventions and substantive checks.

1
Set the likelihood and scales.
Specify the observation model, residual structure, units, and any preprocessing before choosing prior scales.
2
Choose interpretable priors.
State score, loading, and residual-variance distributions and their parameters; explain what values they make plausible.
3
Assess implications and sensitivity.
Use prior predictive checks and compare posterior summaries across reasonable prior scales, while respecting the model’s identification conventions.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In the loading update, what happens to posterior shrinkage when \(\tau^2\) decreases while the data and residual variance remain fixed?
  2. For the score example, why does the second feature contribute less information about \(z\) than the first?
  3. If residuals are conditionally Gaussian with known values, \(n=4\), and \(\sum_i e_i^2=2\), what is the posterior distribution under \(\psi\sim\operatorname{IG}(3,1)\)?
  4. Does a normal prior on loadings assign positive probability to an exactly zero loading? What does it do instead?
  5. Name one reason a prior predictive check is useful and one limitation it cannot fix.

Solutions. (1) The prior precision \(1/\tau^2\) increases, so the posterior mean is pulled more strongly toward zero and the posterior variance decreases. (2) Its loading is \(0.5\), so its contribution to score precision is \(\lambda_2^2/\psi_2=0.25\), compared with \(1\) from the first feature. (3) The posterior is \(\operatorname{IG}(3+4/2,1+2/2)=\operatorname{IG}(5,2)\). (4) No. A continuous normal prior assigns probability zero to exactly zero and instead gives relatively more density to small loadings when centered at zero. (5) Prior predictive checks reveal whether prior draws imply implausible data; they cannot correct an inappropriate likelihood or resolve factor non-identifiability by themselves.

Clinical Biostats