Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 20

Eigenvalues Near Zero: Dimensionality and Singularity

Recommended resources

Introduction

In our previous lesson, we established the remarkable properties of symmetric matrices, culminating in the spectral theorem. You learned that any symmetric transformation can be understood as a simple axis-aligned scaling, sandwiched between two rotations. The eigenvalues, , represent the scaling factors along the special, orthogonal directions defined by the eigenvectors.

This lesson pushes that intuition further by asking: what is the significance of the magnitude of an eigenvalue? Specifically, we will investigate what happens when an eigenvalue is zero or very close to it. You will see that an eigenvalue of zero is a definitive sign that a matrix is singular—it collapses space. More subtly, and more relevant to real-world data, you will learn how eigenvalues near zero signal that a matrix is near-singular, a condition that can make machine learning models numerically unstable and unreliable. Finally, we'll connect this to your practical experience with PCA, showing how the spectrum of eigenvalues reveals the intrinsic dimensionality of a dataset, separating meaningful structure from redundancy and noise.


Eigenvalue Zero: The Signature of Singularity

Let's begin with the most extreme case: an eigenvalue of . Recall the defining equation of an eigenvector and its eigenvalue :

If we substitute , the equation becomes:

This equation tells a powerful geometric story. It means that the transformation takes a non-zero vector and squishes it onto the origin vector . Any matrix that collapses a dimension of its input space in this way is singular. Its determinant is zero, and the transformation is irreversible.

This equation, , should look familiar. It's precisely the definition of the null space of a matrix . This reveals a fundamental identity:

The eigenspace corresponding to the eigenvalue is the null space of the matrix.

This isn't just a curiosity; it's a practical tool. If you can spot linear dependencies among the columns of a matrix, you have found its null space. By doing so, you have immediately identified its zero-eigenvalue eigenvectors without any calculation.

The following short video provides an excellent demonstration of this exact principle.

Linear Algebra 17d: Easy Eigenvalues - Nontrivial Null Space

This video from MathTheBeautiful offers a clear, direct connection between a matrix's null space and its zero eigenvalues.

Watch from the beginning to the main point, where the presenter demonstrates how linear dependencies in the columns of a matrix reveal eigenvectors for \lambda=0. Then, notice the clever trick used in the next section, finding the rest, which uses the trace of the matrix to find the final eigenvalue.

So, an eigenvalue of exactly zero signifies that the columns of the matrix are linearly dependent. In the context of a data matrix, this implies perfect feature redundancy—one feature can be exactly described as a combination of others.


Near-Zero Eigenvalues: The Peril of Near-Singularity

In real-world datasets, perfect linear dependence is rare. Far more common is approximate linear dependence, where one feature is almost a combination of others. This is where near-zero eigenvalues become critically important.

A matrix with one or more very small eigenvalues is considered near-singular or ill-conditioned. The transformation it represents doesn't completely collapse a dimension, but it comes very close. This has profound consequences for the stability of many ML algorithms, particularly linear regression.

Recall the normal equations for finding the optimal coefficients in a linear regression model :

To solve for , we must compute the inverse of . If the features in your data matrix are nearly linearly dependent (a problem known as multicollinearity), then the matrix will be near-singular. The eigenvalues of will be very close to zero.

Trying to invert a near-singular matrix is a recipe for numerical instability. Small amounts of noise in your data can cause enormous swings in the computed coefficients . Your model becomes unreliable and its parameters uninterpretable.

The following resource explains this problem clearly and introduces a formal measure of near-singularity called the condition number.

Section 15 Multicollinearity | MATH3714 Linear Regression and ...

This article from a course on Linear Regression provides a concise yet thorough explanation of multicollinearity and its connection to matrix properties.

First, read the section Consequences of Multicollinearity. Focus on how approximate linear dependency leads to huge uncertainties in the estimated coefficients. Next, read Detecting Multicollinearity. This is the core of our lesson. Pay close attention to the definition of the condition number, \kappa(X). Notice how it's defined as the ratio of the largest to the smallest singular value. Since singular values are the square roots of the eigenvalues of X^T X, a very small eigenvalue directly leads to a very large, problematic condition number. The text explicitly states that an eigenvalue of zero corresponds to an infinite condition number—a singular matrix.

The condition number gives us a quantitative measure of how close we are to singularity. A large condition number, driven by eigenvalues near zero, is a major red flag in model training. It warns us that our solution is unstable and highly sensitive to noise in the input data.

This infographic summarizes the diagnostic power of eigenvalues in machine learning. On the right, it shows how the condition number \(\kappa\), derived from the ratio of maximum to minimum eigenvalues, predicts whether optimization will be stable or oscillatory. Below that, it confirms that a matrix with some negative eigenvalues corresponds to a saddle point, not a true minimum.

Small Eigenvalues and Intrinsic Dimensionality

We've seen how near-zero eigenvalues can signal a problem (multicollinearity). But in the context of dimensionality reduction with Principal Component Analysis (PCA), they signal an opportunity.

Imagine your data is high-dimensional—say, expression levels for 20,000 genes. This is the extrinsic dimensionality of your dataset. However, it's likely that the true biological processes are driven by a much smaller number of underlying factors. The effective number of dimensions needed to describe the data's structure is its intrinsic dimensionality.

PCA identifies this intrinsic dimensionality by analyzing the eigenvalues of the data's covariance matrix. Since the covariance matrix is symmetric, its eigenvalues represent the variance of the data along each of its orthogonal principal axes (the eigenvectors).

  • Large eigenvalues correspond to directions of high variance. These are the "important" dimensions that capture the most information about the data.
  • Small eigenvalues correspond to directions of low variance. These dimensions contribute little to the overall structure of the data and may represent noise or redundant information.

By identifying and discarding the directions associated with small or near-zero eigenvalues, we can project the data onto a lower-dimensional subspace that preserves most of its essential structure.

This flowchart illustrates the entire PCA process. The crucial steps are the eigendecomposition of the covariance matrix and the subsequent identification of redundancy, which is signaled by small eigenvalues (\(\lambda\)). This allows for dimensionality reduction by removing the components associated with these small eigenvalues.

A common tool for this is the scree plot, which plots the eigenvalues in descending order. A sharp "elbow" in the plot indicates the point where the eigenvalues become negligible, giving a visual estimate of the intrinsic dimensionality.

The following tutorial from Neuromatch Academy provides a hands-on, code-based exploration of this idea using the famous MNIST dataset of handwritten digits.

Tutorial 3: Dimensionality Reduction & Reconstruction

This interactive tutorial walks through applying PCA to a real dataset, connecting the concepts of eigenvalues, variance explained, and intrinsic dimensionality.

Start by reading the introduction in Section 1. This sets up the problem by contrasting the high extrinsic dimensionality (784 pixels) of the images with the likely much lower intrinsic dimensionality. Next, focus on Section 2. The formula presented here is key: the "variance explained" by the top K components is simply the sum of the top K eigenvalues divided by the sum of all eigenvalues. This directly quantifies the meaning of eigenvalue magnitude. Finally, read through the bonus section on denoising. This provides a brilliant practical insight: the low-variance dimensions identified by small eigenvalues are often where noise resides. By discarding them, you can effectively "denoise" your data, reinforcing the idea that these dimensions are less important for the core signal.

This analysis shows that an eigenvalue's magnitude is context-dependent. In the context of solving a linear system or training a regression model, a near-zero eigenvalue is a warning sign of instability. In the context of PCA, it's a green light to simplify your data.


Conclusion

In this lesson, you've learned to interpret one of the most important diagnostics in linear algebra and machine learning: the magnitude of an eigenvalue.

Key Takeaways:

  • Zero Eigenvalue (): This is an unambiguous sign that a matrix is singular. The corresponding eigenvectors form the null space, representing directions that are completely collapsed by the transformation. This implies perfect linear dependence among features.
  • Near-Zero Eigenvalue (): This indicates a matrix is near-singular and ill-conditioned. In regression, this leads to multicollinearity and numerically unstable models. The condition number, which is based on the ratio of largest to smallest eigenvalues, quantifies this instability.
  • Intrinsic Dimensionality: In PCA, the eigenvalues of the covariance matrix measure the variance along each principal axis. Small eigenvalues signify directions with little information. The number of large eigenvalues provides an estimate of the data's true, or intrinsic, dimensionality.
  • Signal vs. Noise: By discarding the components associated with small eigenvalues, we can perform dimensionality reduction, removing redundancy and often filtering out noise, thereby retaining the core structure of the data.

You have now completed our deep dive into eigenvalues and eigenvectors. You can not only compute them but also interpret their properties to diagnose matrices and understand data structure.

In the next module, we will put all of this theory into practice. We will begin by formally defining and constructing the covariance matrix for a dataset. Then, we will use its eigendecomposition—the concepts you've just mastered—to perform Principal Component Analysis from start to finish, transforming a dataset to reveal its most important underlying structure.