Skip to main content

Welcome to a Grasp lesson

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

Lesson 25

Understanding SVD: A Geometric Perspective

Recommended resources

Introduction

In our previous lessons on Principal Component Analysis, you learned how to find the directions of maximum variance in a dataset by computing the eigenvectors and eigenvalues of its covariance matrix. We concluded by noting that this process, while powerful, requires first forming the covariance matrix, which can be computationally intensive and numerically unstable for very high-dimensional data, such as in genomics.

This lesson introduces a more fundamental and robust tool: the Singular Value Decomposition (SVD). You've mentioned using SVD in your project, and now we will unpack its geometric meaning. We will see that any matrix transformation, no matter how complex it appears, can be decomposed into a sequence of three simple, fundamental actions: a rotation, a scaling, and another rotation. This insight is one of the most beautiful and useful in all of linear algebra, forming the foundation for not only PCA but a vast array of techniques in machine learning and data analysis.


The Geometric Essence of SVD

Before diving into the matrices and equations, let's build a strong geometric intuition. The central idea of SVD is that for any linear transformation, we can find a special set of orthogonal (perpendicular) vectors in the input space that are mapped to another set of orthogonal vectors in the output space. The transformation, when viewed in these special "SVD-aligned" coordinate systems, becomes a simple act of stretching or compressing along the axes.

Imagine applying a linear transformation represented by a matrix to a unit circle. The transformation might rotate, stretch, and shear the circle, turning it into a tilted ellipse. The SVD tells us that we can achieve this same result in three cleaner steps:

  1. First, rotate the circle so that the axes you intend to stretch are aligned with the standard x-y axes.
  2. Then, scale (stretch or compress) along these axes to form an ellipse.
  3. Finally, rotate this new ellipse to its final orientation.

The image below provides a perfect visual summary of this concept. The direct transformation by matrix (top path) is equivalent to the SVD sequence: a rotation (), a scaling (), and a final rotation () (bottom path).

This diagram illustrates the core idea of SVD. Any linear transformation M can be decomposed into an initial rotation (V*), a scaling along orthogonal axes (Σ), and a final rotation (U). The result is the transformation of a unit circle into an ellipse.

To build this intuition from the ground up, the following article provides an excellent explanation without initially relying on mathematical jargon.

Singular Value Decomposition as Simply as Possible

This article, "Singular Value Decomposition as Simply as Possible," begins by explaining the core geometric idea of SVD using the analogy of transforming a square.

Please read the first section, SVD without jargon. Focus on the key insight: any linear transformation, even a shear, can be understood as a simple stretch/compression if you are allowed to rotate the input space first.


The Three Fundamental Transformations

The SVD formalizes this "rotate-scale-rotate" process by factoring a matrix into three specific matrices: . To understand this decomposition, we first need to be crystal clear on what each type of matrix does geometrically.

The whitepaper "The Theory of the Singular Value Decomposition" provides a superb overview of the fundamental transformations. We'll focus on the two types relevant to SVD: rotation and scaling.

The Theory of the Singular Value Decomposition and its ...

This resource explains how different types of matrices correspond to fundamental geometric transformations.

In the section "A Review of Linear Algebra," please read the two subsections: Diagonal Matrices Stretch Basis Vectors: This explains how a diagonal matrix performs a pure scaling operation along the standard basis axes. This is the role of the \Sigma matrix in SVD. Orthonormal Matrices Only Rotate Basis Vectors: This shows that orthonormal matrices (whose columns are perpendicular unit vectors) perform pure rotations without changing lengths or angles. This is the role of the U and V^T matrices in SVD.

As you've just read:

  • Orthonormal matrices ( and ) perform rotations (and reflections). They change the orientation of space but preserve all lengths and angles between vectors.
  • Diagonal matrices () perform scaling. They stretch or compress space along the basis directions.

SVD's genius is showing that any linear transformation can be expressed as a combination of only these two pure transformation types.


Defining the SVD Factorization:

Now we can put the pieces together and formally define the Singular Value Decomposition. Any real matrix of size can be factored into:

Where:

  • is an orthogonal matrix. Its columns are the left singular vectors. They form an orthonormal basis for the output space. This matrix performs the final rotation.
  • (Sigma) is an rectangular diagonal matrix. Its diagonal entries, , are the singular values of . They are always non-negative and are ordered from largest to smallest. This matrix performs the scaling. If , it also handles the change in dimension.
  • is the transpose of an orthogonal matrix . The columns of are the right singular vectors. They form an orthonormal basis for the input space. This matrix performs the initial rotation.

Let's revisit the article "SVD as Simply as Possible" to see how this formal definition maps directly onto the geometric intuition we developed.

Singular Value Decomposition as Simply as Possible

This part of the article connects the geometric idea to the formal matrix equation.

Please read the sections From intuition to definition and The standard formulation. Observe how the author builds the SVD equation for a 2x2 case and then generalizes it to any m \times n matrix.

The key takeaway is that the columns of are the special input vectors that get rotated by to align with the standard axes. Then, scales them. Finally, rotates these scaled vectors to their final positions, which are the columns of .

To see this entire sequence in motion, the following video provides a clear, animated visualization.

SVD Visualized, Singular Value Decomposition explained | SEE Matrix , Chapter 3 #SoME2

This video, "SVD Visualized," offers a fantastic animation of the rotate-scale-rotate sequence.

Please watch from The moment I've been waiting for. The narrator visualizes how a transformation from 3D to 2D space can be understood as the sequential application of the three SVD matrices, transforming a sphere into a rotated ellipse. Pay close attention to the role of each matrix: V^T rotates the sphere, \Sigma flattens and scales it into an ellipse, and U performs the final rotation in the target space.

This visualization confirms the geometric interpretation: the SVD reveals that every linear transformation maps an n-dimensional sphere into an ellipsoid in an m-dimensional space. The singular values () are the lengths of the principal semi-axes of this resulting ellipsoid.


Conclusion

In this lesson, you've delved into the geometric foundation of the Singular Value Decomposition. You've moved beyond simply using SVD as a black-box tool to understanding it as a fundamental decomposition of any matrix transformation into its constituent geometric actions.

Key Takeaways:

  • SVD Factorization: Any matrix can be decomposed into .
  • Geometric Interpretation: This decomposition represents any linear transformation as a sequence of three simpler operations:
    1. An initial rotation performed by .
    2. A scaling along the new axes (and possibly a change of dimension) performed by .
    3. A final rotation in the output space performed by .
  • The Components: and are orthogonal matrices representing the rotations, while the rectangular diagonal matrix contains the non-negative singular values that represent the scaling factors.

You now have the conceptual framework to understand why SVD is so powerful. In our next lesson, we will make the explicit connection between SVD and PCA. You will learn how applying SVD directly to a centered data matrix allows you to find the principal components and their corresponding variances without ever calculating the covariance matrix, providing a more direct, stable, and general approach for dimensionality reduction.