Tutorials › High-Dimensional Genomic Data Analysis › Shrinkage Estimation For Co-Expression Matrices

Co-Expression Networks · Tutorial 487 of 795

Shrinkage Estimation For Co-Expression Matrices

You will derive the bias–variance rationale for shrinkage and examine its effects on individual co-expression weights, matrix eigenvalues, and practical analysis choices.

Advanced 12 min read

What You'll Learn

  • Explain why a sample correlation matrix can be singular when the number of genes exceeds the number of samples.
  • Derive the mean-squared-error trade-off for shrinking a noisy correlation toward zero.
  • Calculate shrunk edge weights and compare them with unshrunk estimates.
  • Show when shrinkage makes a positive semidefinite correlation matrix positive definite.
  • Recognize how the shrinkage target, intensity, and data-quality problems limit interpretation.

Why Shrink a Co-Expression Matrix?

A co-expression matrix summarizes pairwise associations among genes: each off-diagonal entry is an estimated correlation, and each such entry may be used as an edge weight in a network. In genomic data, the number of genes \(p\) can be far larger than the number of samples \(n\). Each correlation is then estimated from limited information, and many correlations are estimated at once. The resulting matrix can contain extreme-looking values that are highly sensitive to the particular samples observed.

Shrinkage stabilizes estimates by moving them toward a specified target, usually zero for off-diagonal correlations. This trades some bias for reduced sampling variability. It does not make every estimated edge more accurate, nor does it turn a correlation into evidence of a causal relationship. The aim is a more stable estimate of the matrix under a stated loss or modeling criterion.

Definition: Let \(X_{ig}\) denote the expression value for sample \(i\) and gene \(g\), where \(i=1,\ldots,n\) and \(g=1,\ldots,p\). Let \(\hat R\) be the sample correlation matrix computed using the same \(n\) complete samples for all genes. Its \((g,h)\) entry is \(\hat r_{gh}\), with diagonal entries equal to 1. For a shrinkage intensity \(\lambda\) between 0 and 1, shrinkage toward the identity matrix is $$ \hat R_{\lambda}=(1-\lambda)\hat R+\lambda I_p. $$ Thus the diagonal stays at 1, while each off-diagonal entry becomes \((1-\lambda)\hat r_{gh}\). The target \(I_p\) represents zero correlation between distinct genes.

The parameter \(\lambda=0\) leaves the sample matrix unchanged; \(\lambda=1\) discards all estimated pairwise correlations and returns the identity matrix. Intermediate values retain the ordering and signs of the unshrunk correlations, while reducing their magnitudes. This simple form is especially useful for understanding the principle. Other procedures may shrink covariance matrices toward a diagonal target or estimate a target and intensity by a more elaborate rule.

Why the High-Dimensional Setting Is Difficult

With complete data and the usual centered sample correlations, the centered expression matrix has at most \(n-1\) independent rows. Consequently, its rank is at most \(n-1\), and the rank of \(\hat R\) is also at most \(n-1\). If \(p\geq n\), then \(\hat R\) cannot have full rank. This is a structural limitation, not merely a matter of an inconvenient algorithm: the observed samples cannot support \(p\) independent directions of variation.

Even when a particular pairwise correlation is estimable, its sampling uncertainty can be substantial when \(n\) is small. The earlier material on sampling uncertainty in genome-wide correlations motivates treating an observed correlation as a noisy estimate, rather than as a fixed property known without error. Shrinkage uses that perspective, but it does not remove uncertainty or replace careful assessment of the data.

The matrix operation above has useful structural properties under specific assumptions: \(\hat R\) is a valid positive semidefinite correlation matrix, all genes use the same samples, and \(0\leq\lambda\leq1\). With pairwise-complete correlations based on different subsets of samples, the assembled matrix need not be positive semidefinite, so the guarantees below do not automatically apply.

A Bias–Variance Justification

Consider one gene pair and write its true correlation as \(\rho\), with sample estimate \(\hat r\). For a simple derivation, assume \(E(\hat r)=\rho\) and \(\operatorname{Var}(\hat r)=V\), where \(V\geq0\). These assumptions are an idealized description of the estimator; in particular, they do not assert that \(V\) is known in an application. Shrink \(\hat r\) toward zero by multiplying it by \(a\), where \(0\leq a\leq1\). Its mean squared error is $$ E\{(a\hat r-\rho)^2\} =\operatorname{Var}(a\hat r)+\{E(a\hat r)-\rho\}^2 =a^2V+(a-1)^2\rho^2. $$ The first term is the variance after scaling, and the second is squared bias. Differentiating with respect to \(a\), the stationary-point equation is $$ 2aV+2(a-1)\rho^2=0. $$ If \(V+\rho^2>0\), solving gives $$ a_{\mathrm{opt}}=\frac{\rho^2}{V+\rho^2}. $$ This lies between 0 and 1. If \(V=\rho=0\), the mean squared error is zero for every \(a\), so every value of \(a\) is a minimizer. This exception matters: the displayed fraction is undefined in that case. The formula is an oracle result because \(\rho\) and \(V\) are generally unknown. It explains the trade-off, rather than supplying a directly usable intensity without further estimation.

Worked Example: The Bias–Variance Trade-Off for One Correlation

Suppose, hypothetically, that a gene pair has true correlation \(\rho=0.60\), and its sample correlation is unbiased with variance \(V=0.16\). Compare its unshrunk mean squared error with the oracle shrinkage factor.

Because \(V+\rho^2=0.16+0.60^2=0.52>0\), the minimizing factor is $$ a_{\mathrm{opt}}=\frac{0.60^2}{0.16+0.60^2} =\frac{0.36}{0.52}=0.6923. $$

With no shrinkage, \(a=1\), so the mean squared error is \(V=0.16\). At \(a=0.6923\), it is $$ (0.6923)^2(0.16)+(0.6923-1)^2(0.36) \mathrel{\approx}0.07669+0.03408=0.1108. $$

Under these hypothetical assumptions, shrinkage lowers mean squared error from 0.16 to about 0.1108. The lower variance more than compensates for the introduced bias. This calculation does not establish that this factor should be used for real data: the true correlation and variance are not ordinarily known.

Effects on Edge Weights and Matrix Structure

Worked Example: Shrinking Several Edge Weights

Suppose a three-gene sample correlation matrix has estimated correlations \(\hat r_{12}=0.72\), \(\hat r_{13}=-0.40\), and \(\hat r_{23}=0.16\). Use \(\lambda=0.25\) in the identity-target rule.

Each off-diagonal value is multiplied by \(1-\lambda=0.75\): $$ \hat r_{12,\lambda}=0.75(0.72)=0.540,\qquad \hat r_{13,\lambda}=0.75(-0.40)=-0.300,\qquad \hat r_{23,\lambda}=0.75(0.16)=0.120. $$

The signs and ranking by absolute magnitude are unchanged in this example, but all three magnitudes are reduced by 25 percent. The diagonal entries remain 1. These are changes to estimated association weights, not changes to the underlying biological relationships. In particular, shrinking a negative correlation moves it toward zero, not toward a positive correlation.

For the matrix structure, let \(\eta_1,\ldots,\eta_p\) be the eigenvalues of \(\hat R\). Since \(\hat R_\lambda=(1-\lambda)\hat R+\lambda I_p\), any eigenvector of \(\hat R\) is also an eigenvector of \(\hat R_\lambda\), and the corresponding eigenvalue becomes $$ \eta_{j,\lambda}=(1-\lambda)\eta_j+\lambda. $$ If \(\hat R\) is positive semidefinite, then every \(\eta_j\geq0\). For \(0<\lambda\leq1\), every shrunk eigenvalue is at least \(\lambda>0\), so \(\hat R_\lambda\) is positive definite. This can make matrix operations that require invertibility mathematically possible. It does not by itself show that the inverse, or any downstream result using it, is scientifically reliable.

Worked Example: A Singular Matrix Becomes Positive Definite

Imagine three standardized gene-expression profiles that are identical across the observed samples. Their sample correlation matrix is $$ \hat R= \begin{pmatrix} 1&1&1\\ 1&1&1\\ 1&1&1 \end{pmatrix}. $$ Its eigenvalues are \(3,0,0\), so it is positive semidefinite but singular. Shrink toward the identity with \(\lambda=0.20\). The off-diagonal correlations become \(0.80\), giving $$ \hat R_{0.20}= \begin{pmatrix} 1&0.80&0.80\\ 0.80&1&0.80\\ 0.80&0.80&1 \end{pmatrix}. $$

The eigenvalues transform to \(0.80(3)+0.20=2.60\) and \(0.80(0)+0.20=0.20\) for each of the other two directions. All are positive; the matrix is now positive definite. The example illustrates a matrix guarantee, not proof that the original profiles are truly identical or that 0.20 is an appropriate shrinkage intensity.

Choosing and Checking a Shrinkage Rule

A shrinkage calculation requires a target and an intensity. The identity target encodes a strong structural assumption for regularization: in the absence of reliable information, off-diagonal correlations are treated as zero. If substantial real co-expression is widespread, shrinking every off-diagonal entry toward zero can remove meaningful signal. Conversely, leaving noisy extremes untouched can make the estimated network unstable. The intensity controls this balance.

In practice, \(\lambda\) may be selected using a specified analytic estimator, resampling, or a validation criterion designed for the intended goal. The criterion matters: a value chosen to predict correlations well need not be optimal for preserving network rankings or a later biological summary. Report the target, how the intensity was selected, and whether the analysis uses the same set of samples for every pair. A single hand-chosen value can be useful for illustrating sensitivity, but should not be presented as uniquely justified.

Useful diagnostics include comparing results across plausible intensities, checking whether the strongest edges or broad patterns change markedly, and confirming that the input matrix is symmetric with unit diagonal and is positive semidefinite. A sharp change in conclusions under modest changes to \(\lambda\) signals that the data do not strongly determine those conclusions. Also inspect the expression data for outliers, batch structure, and unusual distributions: a shrinkage operation does not repair a problematic input correlation estimate.

The simple identity-target rule scales all off-diagonal correlations by the same factor. It therefore preserves their signs and pairwise ranking by absolute value when \(0\leq\lambda<1\), but it cannot distinguish a well-estimated correlation from a poorly estimated one. More flexible estimators may use a diagonal covariance target or allow different amounts of shrinkage, but their assumptions and targets must also be stated. Compared with the raw sample matrix, identity-target shrinkage reduces magnitudes and can improve conditioning; compared with collecting more samples, it is a modeling compromise, not new information. Shrinkage is also distinct from deleting edges: it continuously reduces weights rather than setting selected weights to exactly zero.

Common Mistakes and Limitations

  • Calling shrinkage unbiased. Pulling nonzero correlations toward zero generally introduces bias. The justification is a possible reduction in total error, not absence of bias.
  • Assuming every edge improves. The scalar derivation uses a common model for a pair and an oracle factor. A shared matrix intensity need not be optimal for every gene pair.
  • Ignoring the target. Shrinkage toward zero expresses a modeling choice. If the target is inappropriate, a stable-looking matrix may still be systematically misleading.
  • Using pairwise-complete correlations and claiming a positive-definite result. The convex-combination guarantee requires a positive semidefinite input matrix. Pairwise calculations on different sample subsets may fail that condition.
  • Interpreting reduced correlation as reduced biological coupling. Shrinkage changes estimates to control noise; it does not demonstrate that the underlying association is weaker.
Key takeaway: Shrinkage can stabilize noisy co-expression estimates by reducing off-diagonal magnitudes and, for a positive semidefinite input matrix, can make a singular correlation matrix positive definite. Its benefit depends on the target, intensity, data quality, and analysis objective.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. For \(\lambda=0.30\), what happens to a sample correlation of \(-0.50\) under identity-target shrinkage?
  2. Why is the sample correlation matrix singular when \(p\geq n\) for complete, centered data?
  3. In the scalar derivation, what is the minimizing \(a\) when \(V=0.10\) and \(\rho=0\)?
  4. Does identity-target shrinkage change the diagonal entries? State the resulting diagonal values.
  5. Why may pairwise-complete correlations not receive the positive-definiteness guarantee?

Solutions. (1) Multiply by \(1-\lambda=0.70\): \(0.70(-0.50)=-0.350\). (2) The centered expression matrix has rank at most \(n-1\), so its correlation matrix cannot have rank \(p\) when \(p\geq n\). (3) Since \(V+\rho^2=0.10>0\), \(a=\rho^2/(V+\rho^2)=0\); under the model, shrinking fully to zero minimizes mean squared error. (4) No; the diagonal remains 1 because \((1-\lambda)1+\lambda=1\). (5) Different pairs may use different samples, so their assembled matrix need not be positive semidefinite; the guarantee assumes a valid positive semidefinite input matrix.

Clinical Biostats