Skip to main content

Welcome to a Grasp lesson

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

Lesson 34

Singular Values and Vectors

Recommended resources

Hello! Welcome to the first lesson in our module on the Singular Value Decomposition (SVD).

In the previous module, we saw how powerful the Spectral Theorem is for understanding symmetric matrices. We could decompose them into , which revealed their geometric action and simplified quadratic forms. However, this decomposition only works for specific matrices (square and symmetric or Hermitian). What about the vast majority of matrices that are rectangular or non-symmetric?

This is where the Singular Value Decomposition (SVD) comes in. It is arguably the most important matrix decomposition, acting as a generalization of the spectral decomposition that applies to any matrix. Today, our goal is to define singular values and the left and right singular vectors of a matrix. We'll break down the SVD equation, name its parts, and build an intuition for what they represent.

1. The SVD Equation: A First Look

The Singular Value Decomposition states that any matrix can be factored into the product of three other matrices:

This decomposition breaks down the action of the matrix into three fundamental components. Let's get acquainted with them.

Singular Value Decomposition Formula with Labeled Components
A visual representation of the Singular Value Decomposition. The matrices U, Σ, and V have special properties and names that we will now explore.

The video below gives a great high-level introduction to these three matrices and their properties.

Singular Value Decomposition (SVD): Mathematical Overview

This video from Steve Brunton provides a clear overview of the SVD formula and introduces the names for each component.

Watch from 2:56 to 4:37, and then from 6:32 to 8:05. The first part introduces the U, Sigma, and V matrices. The second part explicitly names them and describes their hierarchical ordering.

As the video explains, the components are:

  • : An orthogonal matrix. Its columns are called the left singular vectors.
  • : An rectangular diagonal matrix. The non-negative diagonal entries, denoted , are called the singular values. They are ordered from largest to smallest: .
  • : An orthogonal matrix. Its columns are called the right singular vectors. Note that the formula uses its transpose, .

This structure should feel somewhat familiar. It resembles the decomposition, but with two different orthogonal matrices ( and ) instead of just one (). This is what gives SVD the flexibility to work for any matrix.


2. The Geometric Meaning of SVD

The real power of SVD comes from its geometric interpretation. It tells us that any linear transformation can be decomposed into a sequence of three simple operations:

  1. A rotation (and/or reflection) in the input space.
  2. A scaling along the coordinate axes.
  3. A rotation (and/or reflection) in the output space.

The following resource provides a fantastic, jargon-free explanation of this idea.

Singular Value Decomposition as Simply as Possible

This article by Gregory Gundersen builds the geometric intuition for SVD from the ground up, showing how any linear transformation can be viewed as rotation-scaling-rotation.

Please read the first two sections, 'SVD without jargon' and 'From intuition to definition'. Focus on the visual argument of transforming a square (or circle) and how this leads to the core SVD equation.

Here's how the matrices from the SVD equation map to this geometric picture:

  • performs the initial rotation in the input space.
  • performs the scaling. The singular values are the scaling factors along each axis.
  • performs the final rotation in the output space.
Geometric Interpretation of Singular Value Decomposition (SVD)
The action of a matrix A on a unit circle. SVD breaks this down into: 1. A rotation by V^T, which aligns the right singular vectors (v1, v2) with the standard axes. 2. A scaling by Σ, which stretches the circle into an ellipse with semi-axes of length σ1 and σ2. 3. A rotation by U, which aligns the ellipse's axes with the left singular vectors (u1, u2).

The singular vectors and values have a precise relationship that defines this transformation. For each right singular vector and corresponding left singular vector , the matrix transforms into a scaled version of :

This is a central equation in SVD. It's similar to the eigenvector equation , but here the input vector () and output vector () are from different orthogonal bases. The SVD finds the special orthonormal basis in the input space () that gets mapped to an orthogonal basis in the output space (), with the only coupling being the scaling factors .


3. A Constructive Definition: The Link to Eigenvalues

So far, we've defined the singular vectors and values as parts of the SVD equation. But how are they actually found? This gives us a more concrete, constructive definition. The key is to create a symmetric matrix from , which allows us to use the tools from our previous module.

Consider the matrix . If , then:

Since is orthogonal, . This simplifies to:

This is the eigenvalue decomposition of the symmetric matrix ! This tells us:

  • The right singular vectors (columns of ) are the eigenvectors of .
  • The singular values () are the square roots of the eigenvalues of . ().

Similarly, if we look at :

This tells us:

  • The left singular vectors (columns of ) are the eigenvectors of .

The following video with Professor Strang explains this derivation clearly.

Singular Value Decomposition (the SVD)

Professor Gilbert Strang from MIT OpenCourseWare explains how to find the components of the SVD by relating them to the eigenvalues and eigenvectors of A^T A and AA^T.

Watch from the beginning to 6:39. Pay close attention to how he constructs A^T A and AA^T to find the V, Σ, and U matrices.

Test your understanding!

You are told that the matrix has eigenvalues , , and , with corresponding orthonormal eigenvectors . What are the singular values of ? Which singular vectors of have you just been given?

Show answer

The singular values are the square roots of the non-zero eigenvalues of . So, and . Note that singular values are non-negative.

The eigenvectors of are the right singular vectors of . So, we have been given the right singular vectors .


4. An Alternative Viewpoint: Directions of Maximum "Action"

There's another powerful way to define singular vectors that is especially useful in data science. Instead of starting with the decomposition, we can define the singular vectors greedily.

Imagine you have a cloud of data points represented by the rows of matrix . You want to find the direction in space (a unit vector ) such that when you project all your data points onto it, the sum of the squared projection lengths is maximized. This direction is the "most important" direction in your data.

It turns out:

  • The first right singular vector is precisely this direction: .
  • The first singular value is the value of this maximum: .
  • The second right singular vector is the direction, orthogonal to , that maximizes .
  • And so on.

This approach defines the singular vectors and values in order of importance, which is a key reason why SVD is so useful for data compression and analysis.

Singular Value Decomposition (SVD) from CMU

This text provides a more formal, but highly intuitive, definition of singular vectors as the directions that successively maximize the projection of a data matrix.

Read Section 1.1, 'Singular Vectors' (pages 3-4), and the definition of the left singular vectors at the top of page 5 ('ui = (1/sigma_i)Avi'). This provides a different but complementary definition to the one based on A^T A.


Conclusion

In this lesson, we have introduced the Singular Value Decomposition and defined its core components. While we've approached it from several angles, they all describe the same fundamental structure.

Key Takeaways:

  • Any matrix can be decomposed as , where and are orthogonal matrices and is a diagonal matrix of singular values.
  • The columns of are the left singular vectors, which are the eigenvectors of .
  • The columns of are the right singular vectors, which are the eigenvectors of .
  • The diagonal entries of are the singular values (), which are the square roots of the eigenvalues of (or ).
  • Geometrically, SVD decomposes any linear transformation into a rotation (), a scaling by the singular values (), and another rotation ().
  • The relationship connects the singular vectors and values, showing how maps one orthonormal basis to another.

Preview of the Next Lesson:

We now know what the singular values and vectors are. In the next lesson, we will put this knowledge into practice and construct the full and reduced Singular Value Decomposition of a matrix. We'll work through a concrete example from start to finish, using the eigenvalue-based method we learned about today.