Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Explained Variance and Scree-Plot Decisions

Dimension Reduction and Embeddings · Tutorial 206 of 700

Explained Variance and Scree-Plot Decisions

Calculate and interpret PCA variance summaries, compare scree-plot heuristics, and recognize why a variance cutoff alone cannot establish biological relevance.

Intermediate 10 min read

What You'll Learn

  • Define PCA explained-variance ratios and cumulative explained variance, including when the ratios are defined.
  • Calculate component-wise and cumulative variance summaries from hypothetical eigenvalues.
  • Interpret scree plots and distinguish a visual elbow from a cumulative-variance threshold.
  • Explain why large variance is not, by itself, evidence of biological importance.
  • Identify common computational and interpretive failures in variance summaries.
  • Compare variance-based summaries with stability checks and biological validation.

Why Summarize PCA Variance?

PCA replaces a collection of measured features with ordered directions that capture variation in the data. The eigenvalues quantify how much variance is associated with those directions. Explained-variance ratios and scree plots turn that ordered list into summaries that can help describe how concentrated or dispersed the variation is.

These summaries are useful, but their scope is limited. They report variance in the input matrix; they do not identify what caused that variance or whether it corresponds to a biological process of interest. In single-cell RNA sequencing, a large source of variation might reflect biology, technical differences, or both. A variance threshold is therefore a descriptive rule, not proof that retained axes are biologically meaningful.

Definitions and Conditions

Let \(X\) be an \(n\times p\) matrix of centered values, with cells in rows and features in columns, where \(n>1\). Centering means each feature column has sample mean zero. Define the sample covariance matrix as \(S=X^\mathsf{T}X/(n-1)\), and let its eigenvalues be ordered from largest to smallest: \(\lambda_1\geq\lambda_2\geq\cdots\geq\lambda_p\geq 0\). Eigenvalues are nonnegative because \(S\) is positive semidefinite. The common factor \(1/(n-1)\) gives the eigenvalues variance units.

Definition: If the total variance \(T=\sum_{\ell=1}^{p}\lambda_\ell\) is positive, the explained-variance ratio for principal component \(j\) is \(r_j=\lambda_j/T\). The cumulative explained variance through component \(k\) is \(R_k=\sum_{j=1}^{k}r_j\). These ratios are defined only when \(T>0\); if every eigenvalue is zero, the ratio is undefined.

The total \(T\) is the sum of the sample variances of the centered input features. Ratios are dimensionless: \(r_j\) describes the fraction of total variance associated with component \(j\), and \(R_k\) describes the fraction associated with the first \(k\) components. When \(T>0\), every ratio is between zero and one, the ratios sum to one, and the cumulative values cannot decrease.

The values depend on the matrix submitted to PCA. The features included, their units, and any preprocessing affect the variance being summarized. Thus, “explains 80%” means 80% of the variance in that particular input matrix, not 80% of all biological variation in the cells.

Why the Ratios Sum to One

A short linear-algebra argument establishes the interpretation. Let \(v_j\) be a unit eigenvector of \(S\) for \(\lambda_j\). The projected cell values in component \(j\) are \(Xv_j\). Their sample variance is

$$ \frac{(Xv_j)^\mathsf{T}(Xv_j)}{n-1} = v_j^\mathsf{T}Sv_j = v_j^\mathsf{T}(\lambda_j v_j) = \lambda_j, $$

because \(v_j^\mathsf{T}v_j=1\). The total variance of the original features is \(\operatorname{tr}(S)\), the sum of the diagonal entries of \(S\). The trace of a matrix equals the sum of its eigenvalues, so \(\operatorname{tr}(S)=\sum_{\ell=1}^{p}\lambda_\ell=T\). Consequently, the fraction for component \(j\) is its variance divided by the total, \(\lambda_j/T\). Summing over \(j\) gives \(\sum_{j=1}^{p}r_j=T/T=1\), provided \(T>0\).

Centering and \(n>1\) make the stated sample covariance well-defined. If the centered matrix is all zeros, then \(S\) is also all zeros and \(T=0\). In that case no variance is present to apportion, so it is incorrect to report ratios of zero or to claim that they sum to one. More generally, centered data can have zero eigenvalues when its rank is less than \(p\); these components have zero ratio as long as the total variance is positive.

Worked Example: Ratios and Cumulative Variance

Suppose a hypothetical PCA has four eigenvalues, in variance units, of \(4, 2, 1,\) and \(1\). First check the total: \(T=4+2+1+1=8\), which is positive, so the ratios are defined.

For component 1, \(r_1=4/8=0.50\). For component 2, \(r_2=2/8=0.25\). For components 3 and 4, \(r_3=1/8=0.125\) and \(r_4=1/8=0.125\). In percentage terms, the components explain 50%, 25%, 12.5%, and 12.5% of the variance in this input matrix.

The cumulative values are \(R_1=0.50\), \(R_2=0.50+0.25=0.75\), \(R_3=0.75+0.125=0.875\), and \(R_4=0.875+0.125=1.00\). Thus, the first two components account for 75% of the total variance, while the first three account for 87.5%. These calculations describe variance concentration; they do not establish that any component represents a particular cell state or mechanism.

Reading a Scree Plot

A scree plot displays component number on the horizontal axis and either the eigenvalue or its explained-variance ratio on the vertical axis. Since every ratio is the corresponding eigenvalue multiplied by the same positive constant \(1/T\), these two versions have the same ordering and overall shape. The ratio version makes the vertical scale a fraction of total variance; the eigenvalue version retains variance units.

A common visual heuristic is to look for an “elbow”: a point after which successive eigenvalues decline more gradually. The components before a pronounced elbow account for relatively large amounts of variance compared with those after it. This is a descriptive cue, not a mathematically unique cutoff. A smooth decline may have no clear elbow, and different viewers may choose different locations.

A cumulative-variance rule works differently. It selects the smallest \(k\) for which \(R_k\) reaches a prespecified threshold, such as 0.90. The threshold gives a reproducible arithmetic criterion once the cutoff is specified, but the chosen percentage is a convention rather than a universal statistical law. It can require many components when variance is diffuse, or very few when a few components dominate.

Worked Example: Applying a Cumulative Threshold

Consider hypothetical eigenvalues \(6, 2, 1, 0.5,\) and \(0.5\), with total \(T=6+2+1+0.5+0.5=10\). The ratios are \(0.60, 0.20, 0.10, 0.05,\) and \(0.05\). Their cumulative values are \(0.60, 0.80, 0.90, 0.95,\) and \(1.00\).

If the stated rule is to retain the smallest number of components reaching at least 90% of the variance, then \(R_1=0.60\) and \(R_2=0.80\) are below the threshold, while \(R_3=0.90\) reaches it. The rule therefore selects three components. It does not show that these components capture 90% of biological signal; it shows only that they account for 90% of the total variance measured in the input matrix.

Variance Is Not Biological Meaning

PCA ranks directions by variance, not by biological importance. A strong technical gradient can dominate the leading eigenvalue even if the scientific goal is to distinguish a subtler cell state. Conversely, a rare but important population may contribute little to total variance because it involves relatively few cells. A cutoff such as 90% can therefore retain many weak or technical directions while still failing to ensure that a scientifically relevant pattern is represented.

For example, suppose a hypothetical cell matrix has eigenvalues \(5, 2, 1, 1\), for a total of \(9\). The first two ratios are \(5/9\approx0.556\) and \(2/9\approx0.222\), so \(R_2=7/9\approx0.778\). If independent experimental records indicate that the strongest variation is associated with sequencing depth, the fact that the first component explains about 55.6% does not make it a biologically relevant axis. The eigenvalue alone cannot reveal the source of variation. Biological interpretation requires evidence beyond the variance summary.

The reverse caution matters too: a component with a modest ratio is not automatically noise or irrelevant. It may capture a structured pattern that matters for a specific question. Variance summaries are global: they aggregate squared deviations across cells and features, so they need not prioritize rare or localized structure.

Key takeaway: Explained-variance ratios answer “how much variance in this input matrix is assigned to each component?” They do not answer “what caused the variance?” or “which components are biologically important?”

Diagnostics, Alternatives, and Limitations

Before interpreting the plot, check that the eigenvalues are nonnegative up to small numerical rounding error, are listed in descending order, and correspond to the same PCA input used for interpretation. Recompute the total \(T\) and confirm that the ratios sum to approximately one and the final cumulative value is approximately one when \(T>0\). Small discrepancies can arise from rounding; substantial discrepancies suggest an indexing, normalization, or transcription error.

A zero or negative total is not a situation in which to proceed with ratios: for a valid covariance matrix the eigenvalues are nonnegative, and zero total means no variance in the analyzed matrix. Also distinguish a zero eigenvalue within a positive-total spectrum, which simply contributes zero, from a zero total, which makes every ratio undefined.

The main choices answer different questions:

ApproachWhat it summarizesMain limitation
Explained-variance ratioFraction assigned to an individual componentDoes not identify the source or biological value of that variance
Cumulative-variance thresholdSmallest component count reaching a chosen fractionThe threshold is conventional and can retain unwanted variation
Scree-plot elbowVisual change in the rate of eigenvalue declineCan be ambiguous or absent; visual choice is subjective
Stability or biological validationWhether patterns persist under reasonable perturbations or align with independent evidenceRequires additional analyses and depends on the scientific question

These approaches are complementary, not interchangeable. A threshold or elbow is a compact description of the spectrum. Stability checks and independent biological evidence address different concerns, although they too have assumptions and limitations. No single variance summary can validate a biological interpretation. In particular, when eigenvalues are tied or nearly tied, the corresponding individual directions may not be uniquely determined; the variance associated with their shared subspace can be more stable than an interpretation attached to one direction alone.

Common Mistakes

  • Dividing by a zero total. If all eigenvalues are zero, \(0/0\) is undefined; do not report zero ratios or claim they sum to one.
  • Calling a threshold a guarantee. Reaching 90% means 90% of input-matrix variance, not 90% of biological information.
  • Reading an elbow as an exact boundary. An elbow is a visual heuristic, and some spectra have no convincing elbow.
  • Ignoring the analyzed features. Ratios refer to the matrix actually supplied to PCA; changes in features or preprocessing can change the spectrum.
  • Assuming small variance means no value. A low-variance component may still contain a pattern relevant to a particular scientific question.

Worked Example: Zero Eigenvalues and a Zero Total

Suppose a hypothetical centered data matrix has eigenvalues \(3, 1, 0,\) and \(0\). Here \(T=3+1+0+0=4>0\), so ratios are defined: \(3/4=0.75\), \(1/4=0.25\), \(0/4=0\), and \(0/4=0\). The cumulative values are \(0.75, 1.00, 1.00,\) and \(1.00\). The last two components contribute no additional variance.

By contrast, if all four eigenvalues were zero, then \(T=0\). The proposed ratio for the first component would be \(0/0\), which is undefined, and the same is true for every component. A correct report would state that the analyzed matrix has no total variance and that explained-variance ratios cannot be computed, rather than presenting a cumulative curve.

Check Your Understanding

Work through each question, then compare with the solutions below.

  1. For eigenvalues \(4, 3, 1\), calculate the total variance, each explained-variance ratio, and the cumulative variance through the second component.
  2. For eigenvalues \(2, 2, 0, 0\), are the ratios defined? What is the cumulative variance after the first two components?
  3. A spectrum has no clear elbow, but the first four components reach a prespecified 85% threshold. What can you conclude, and what can you not conclude?
  4. What should be reported if all eigenvalues are zero?

Solutions. (1) \(T=4+3+1=8\). The ratios are \(4/8=0.50\), \(3/8=0.375\), and \(1/8=0.125\); the cumulative value through component 2 is \(0.50+0.375=0.875\), or 87.5%. (2) Yes, because \(T=2+2=4>0\). The ratios are \(0.50, 0.50, 0,\) and \(0\), so cumulative variance after two components is 1.00. (3) You can conclude that four components are the smallest number reaching 85% under that stated rule. You cannot conclude that they are biologically meaningful or that four is a uniquely correct cutoff. (4) The total is zero, so the ratios are undefined; report that the matrix has no total variance to apportion and do not calculate a cumulative ratio.

Clinical Biostats