Why Specify Cross-Omics Dependence?
A simulation can have realistic values within each omics modality and still be a poor benchmark if it gets the relationships between modalities wrong. For example, a method that combines molecular measurements may behave differently when matched features share substantial correlation than when the modalities are nearly independent. A simulation should therefore specify not just the separate distributions of each modality, but also the dependence between measurements made on the same individual.
This tutorial focuses on generating and checking that dependence. It does not specify outcome-related or modality-specific signals: those are separate design choices. Assume that the rows of the modality matrices refer to the same \(n\) individuals, as required for a cross-modal association to be meaningful. This relies on the matched-cohort setup from the earlier material on generating matched multi-omics cohorts.
A dependence specification should be stated in terms of a target: for example, a particular cross-modal correlation for selected feature pairs, or a pattern of cross-modal covariance across blocks of features. The target is a population property of the generating mechanism. A finite simulated data set will generally show a different empirical covariance or correlation because of sampling variation.
Generating Dependence With a Shared Latent Variable
A direct construction uses a shared random variable to induce dependence. For each individual \(i\), generate a latent variable \(Z_i\) with mean zero and variance one. For standardized features, use
Here \(\lambda_j\) and \(\gamma_k\) are loadings between \(-1\) and \(1\). Assume that the \(Z_i\) are independent across individuals; all residuals \(\varepsilon_{ij}\) and \(\eta_{ik}\) are mutually independent, independent of all \(Z_i\), and have mean zero and variance one. A convenient distributional choice is standard normal for every variable in the construction. The square-root residual coefficients ensure that every feature has variance one.
The shared \(Z_i\) induces cross-modal dependence. Since the residuals are independent,
Because both features have variance one, this is also their correlation. Within a modality, the same construction gives \(\operatorname{Cov}(X_{ij},X_{i\ell})=\lambda_j\lambda_\ell\) for distinct features, and similarly for \(Y\). Thus a single shared factor creates a structured, rank-one cross-modal covariance block, not arbitrary pairwise correlations. Loading signs matter: features with loadings of opposite signs have negative cross-modal correlation.
Worked Example: Setting a Cross-Modal Correlation With Loadings
Suppose one feature in modality \(X\) has loading \(\lambda_1=0.6\), and one feature in modality \(Y\) has loading \(\gamma_1=0.5\). Both are generated with independent standard-normal residuals and a shared standard-normal \(Z_i\). Find their population variances and cross-modal correlation.
For the \(X\) feature, the residual coefficient is \(\sqrt{1-0.6^2}=\sqrt{0.64}=0.8\). Its variance is \(0.6^2+0.8^2=0.36+0.64=1\). For the \(Y\) feature, the residual coefficient is \(\sqrt{1-0.5^2}=\sqrt{0.75}\), giving variance \(0.5^2+0.75=1\).
The shared-factor contribution to their covariance is \(0.6 \times 0.5=0.30\). Since each variance is one, their population correlation is \(0.30\). If instead \(\gamma_1=-0.5\), the correlation would be \(0.6 \times (-0.5)=-0.30\). The specified dependence is about measurements on the same individual; independently permuting the rows of one modality would break this pairing.
For more than one shared factor, write \(Z_i\) as a vector with covariance matrix \(I\), and let loading vectors be \(a_j\) and \(b_k\). Provided the residual variances are nonnegative, a model of the form \(X_{ij}=a_j^\mathsf{T}Z_i+\varepsilon_{ij}\) and \(Y_{ik}=b_k^\mathsf{T}Z_i+\eta_{ik}\) gives cross-modal covariance \(a_j^\mathsf{T}b_k\). The number and arrangement of factors therefore determine the structure that can be represented. This remains a structured model: choosing loadings does not grant independent control over every entry of the cross-modal matrix.
Generating a Specified Joint Covariance
When the target is a particular covariance pattern, a direct multivariate-normal construction can be more flexible. Write the combined feature vector for individual \(i\) as \(W_i=(X_i^\mathsf{T},Y_i^\mathsf{T})^\mathsf{T}\), and specify
The within-modality covariance matrices are \(\Sigma_X\) and \(\Sigma_Y\); the cross-modal covariance matrix is \(C\). A necessary and sufficient condition for this to be a valid covariance matrix is that \(\Sigma\) be symmetric and positive semidefinite, meaning \(v^\mathsf{T}\Sigma v\geq 0\) for every vector \(v\). If \(\Sigma\) is positive definite, a Cholesky factorization \(\Sigma=LL^\mathsf{T}\) permits generation by drawing \(G_i\sim N(0,I)\) and setting \(W_i=LG_i\). For a positive semidefinite matrix that is not positive definite, a suitable eigenvalue-based square root can be used instead.
Worked Example: Checking a Structured Covariance
Consider two features in each modality. Set the within-modality covariance matrices to \(\Sigma_X=\Sigma_Y=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}\), and specify \(C=0.2I\). This targets cross-modal correlation \(0.2\) for corresponding features and zero for noncorresponding features. Determine whether the resulting joint covariance is valid.
The joint covariance is \(\Sigma=\begin{pmatrix}1&0.5&0.2&0\\0.5&1&0&0.2\\0.2&0&1&0.5\\0&0.2&0.5&1\end{pmatrix}\). To check its eigenvalues, use vectors whose two within-modality feature entries are either equal or opposite. The within-modality covariance has eigenvalues \(1.5\) and \(0.5\); the cross-block \(0.2I\) contributes \(+0.2\) or \(-0.2\) in the corresponding combined directions. The four joint eigenvalues are therefore \(1.7, 1.3, 0.7,\) and \(0.3\).
All four eigenvalues are positive, so \(\Sigma\) is positive definite and defines a valid nondegenerate multivariate-normal distribution. A Cholesky factor can be used to generate each individual’s four measurements jointly. Merely writing down plausible-looking within- and cross-modal blocks would not establish validity; the full matrix must meet the positive-semidefinite condition.
Verifying the Dependence in Simulated Data
Verification has two parts. First, check the specification itself: confirm that the intended covariance matrix is valid, that loadings imply the intended population covariances, and that all modalities use the same individual ordering. Second, check simulated output: estimate cross-modal covariance or correlation and compare it with the target. These checks answer different questions. A valid model can produce a finite sample whose empirical dependence differs noticeably from the target, while a close empirical match in one sample does not prove that the simulation code implements the intended model in general.
For feature \(j\) in \(X\) and feature \(k\) in \(Y\), the empirical covariance and correlation are
Compare the statistic that matches the target: use covariance for a covariance specification and correlation for a correlation specification. Also inspect the entire cross-modal matrix where feasible. Checking only its average can conceal incorrect signs, misplaced associations, or a block of unintended dependence. For a simulation study, repeat the check across independent generated data sets and summarize the distribution of empirical dependence; this distinguishes systematic implementation errors from ordinary finite-sample fluctuation.
Worked Example: Comparing an Empirical Correlation With Its Target
A hypothetical simulation targets correlation \(0.30\) between one feature in each modality. In one generated data set with \(n=100\) individuals, the centered sums of squares are \(96\) for the first feature and \(100\) for the second; their centered cross-product sum is \(27.6\). Compute the empirical correlation.
Using the correlation formula, the common factor \(1/(n-1)\) cancels between the covariance and standard deviations. Thus \(r=27.6/\sqrt{96\times100}=27.6/\sqrt{9600}=27.6/97.98=0.2817\).
The empirical correlation, about \(0.282\), is close to the target \(0.30\), but it is not exactly equal to it. That difference is expected in a finite sample. It would be inappropriate to conclude from this one data set alone that the implementation is correct; a broader check should verify that other feature pairs and repeated simulated data sets behave as specified.
Diagnostics, Comparisons, and Limitations
When a check fails, first separate a specification problem from a sampling problem. A non-positive eigenvalue in a proposed joint covariance is a structural failure: that matrix cannot be used as the covariance of the intended nondegenerate multivariate normal. An empirical discrepancy in a valid simulation may instead be finite-sample variation. Further diagnostic clues include:
- Incorrect or permuted cross-modal associations: inspect the individual row alignment and the indexing used to construct the cross-modal block.
- Unexpectedly large associations: check for duplicated variables, residuals that are not independent as intended, or an incorrectly scaled latent factor.
- Unexpected within-modality correlations: shared factors generally induce within-modality dependence as well as cross-modal dependence. Compare both blocks with the model’s implied covariance.
- Numerical failures in matrix factorization: inspect symmetry and eigenvalues, and distinguish small numerical tolerances from genuinely negative eigenvalues. Do not silently change the target matrix without documenting the change.
- Extreme empirical correlations in small samples: remember that sample correlations fluctuate; check repeated simulations rather than treating a single draw as a precise estimate of the population target.
The latent-variable construction is compact and interpretable: loadings directly describe how strongly features relate to shared variation, and valid covariance follows from the construction. Its limitation is structural: a small number of factors cannot express every arbitrary cross-modal pattern, and shared factors also induce within-modality structure. Direct covariance specification offers finer control over particular entries, but requires a valid full covariance matrix and can become difficult to design as feature dimensions grow. Neither construction automatically guarantees realistic marginal distributions, dependence beyond the chosen model, or an appropriate biological interpretation. These are assumptions to assess for the intended benchmark, not properties supplied by the formulas alone.
A common mistake is to set each desired cross-modal correlation separately and assume the resulting matrix must be valid. Pairwise values can each lie between \(-1\) and \(1\), yet the full joint covariance can still fail positive semidefiniteness. The correction is to validate the complete covariance matrix, or use a generative construction whose assumptions guarantee a valid joint distribution. Another mistake is to treat a simulated sample correlation as the population target: the target belongs to the generating mechanism, while the observed statistic is a random estimate that varies across repetitions.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In the shared-factor model, let \(\lambda_j=-0.4\) and \(\gamma_k=0.7\). What is the cross-modal correlation, assuming standardized features and independent residuals?
- Why can independently permuting the rows of one modality invalidate a simulation of cross-omics dependence?
- A proposed joint covariance has a negative eigenvalue. Can it be used as the covariance matrix for the specified nondegenerate multivariate-normal simulation? Explain.
- One simulated data set has empirical correlation \(0.24\) when the target is \(0.30\). Does this alone establish that the code is wrong? What is a useful next check?
- State one advantage and one limitation of using a shared latent factor rather than specifying the full joint covariance directly.
Solutions. (1) The correlation is \((-0.4)(0.7)=-0.28\). (2) The shared latent values for an individual would no longer be paired with that individual’s measurements in the other modality, so the intended cross-modal dependence is disrupted. (3) No. A covariance matrix must be positive semidefinite; a negative eigenvalue means some linear combination would have negative variance. (4) No. A single finite sample can differ from its population target. Check the cross-modal matrix and repeat the simulation across independent data sets to assess whether the deviations are consistent with sampling variation. (5) A shared factor gives an interpretable construction with valid covariance by design, but it imposes a structured dependence pattern and can induce within-modality correlations as well.