Seyed Masoud Hosseini · Overview · Study log · Weekly summaries · Ideas · Search · Transcript · RSS feed

Matrix Methods for Data Analysis & ML · Lecture 8 of 36 · 53:33

Lecture 6: Singular Value Decomposition (SVD)

6. Singular Value Decomposition (SVD) on YouTube

Study guide

What this lecture covers

Since a rectangular matrix has no eigenvalues in the usual sense, Strang introduces a replacement that works for every matrix: the singular value decomposition, A = UΣV^T. He builds it from A^T A, a symmetric positive definite matrix whose eigenvectors become the right singular vectors V, while the corresponding U = AV/σ vectors turn out to be the eigenvectors of AA^T and, crucially, orthogonal to each other.

The lecture also gives the geometric picture of the SVD as rotate, stretch, rotate, counts how many parameters each factor contributes, and derives the polar decomposition as a quick corollary. It ends by identifying the leading rank-one piece σ1 u1 v1^T as the most important part of a data matrix, setting up the next lecture on principal components. After watching you should be able to state what the SVD factors are, explain why the singular vectors are orthogonal, and describe the rotate-stretch-rotate geometric picture.

Key ideas

  • Why eigenvalues fail for rectangular matrices: Ax = λx requires A to map a space to itself, which is impossible when A is not square, so the SVD uses two different sets of vectors instead.
  • A^T A is the key matrix: it is always square, symmetric, and positive semidefinite, so it factors as VΛV^T, giving the right singular vectors V as its eigenvectors and the singular values σ as the square roots of its eigenvalues.
  • AA^T gives the left singular vectors: this matrix (a different size than A^T A) is also symmetric positive semidefinite, and its eigenvectors are the U vectors; the two matrices share the same nonzero eigenvalues.
  • Orthogonality of AV: choosing U_i = AV_i / σ_i and using that the V_i are orthogonal eigenvectors of A^T A proves the resulting U_i vectors are also orthogonal, which is the key fact making the SVD work.
  • Rotate, stretch, rotate: A = UΣV^T means multiplying by A first rotates (via V^T), then stretches along axes by the singular values (via Σ), then rotates again (via U).
  • Parameter counting: for a 2x2 matrix, 4 entries split into 1 rotation angle (V), 2 stretch factors (Σ), and 1 rotation angle (U), matching the 4 degrees of freedom of the original matrix.
  • Polar decomposition: inserting U^T U = I into A = UΣV^T gives A = (UΣU^T)(UV^T), a symmetric matrix times an orthogonal matrix, the matrix analog of writing a complex number as a magnitude times e^(iθ).
  • Leading rank-one piece: σ1 u1 v1^T, built from the largest singular value, is the single most important rank-one piece of a data matrix, the starting point for principal component analysis.

Walkthrough

Why rectangular matrices need singular vectors, not eigenvectors (0:01)

Strang explains that Ax = λx cannot hold for a rectangular matrix since Ax lands in a different-dimensional space than x. The SVD replaces one set of eigenvectors with two: left singular vectors U and right singular vectors V, connected by singular values σ on a diagonal matrix in between, generalizing the spectral theorem to every matrix.

Building V and sigma from A^T A (4:04)

Strang shows A^T A is always symmetric and positive semidefinite, so it factors as VΛV^T, giving the eigenvectors V and eigenvalues λ = σ^2. Separately, AA^T, a different-sized matrix with the same nonzero eigenvalues, gives the eigenvectors U. Substituting A = UΣV^T into A^T A and using U^T U = I confirms this matches the eigendecomposition of A^T A exactly.

Proving the U vectors are orthogonal (17:12)

To handle repeated eigenvalues correctly, Strang defines U_i = A V_i / σ_i directly rather than relying only on AA^T. He then proves U1^T U2 = 0 by substituting the definitions, using that V2 is an eigenvector of A^T A with eigenvalue σ2^2, and that V1 and V2 are orthonormal, so the singular vectors in the column space inherit orthogonality from the singular vectors in the row space. He also notes that computing the SVD in practice avoids forming A^T A directly, since doing so squares the matrix's sensitivity to rounding error.

The rotate-stretch-rotate picture and parameter counts (28:23)

Strang draws the geometric picture: multiplying a unit circle by V^T rotates it, multiplying by Σ stretches it into an ellipse along the singular value directions, and multiplying by U rotates the ellipse again. He counts parameters for a 2x2 matrix (1 rotation angle from V, 2 stretch factors from Σ, 1 rotation angle from U, totaling 4, matching the matrix's 4 entries) and notes that U = V exactly when the original matrix is symmetric positive definite, in which case the SVD reduces to the spectral theorem.

Polar decomposition and the leading rank-one piece (45:39)

Inserting U^T U = I into A = UΣV^T gives A = (UΣU^T)(UV^T), the polar decomposition of A into a symmetric matrix times an orthogonal matrix, paralleling the magnitude-times-rotation form of a complex number. Strang closes by identifying σ1 u1 v1^T, built from the largest singular value, as the most important rank-one piece of a data matrix, the starting point for finding principal components in the next lecture.

Before you watch

  • Watch Lecture 4 on eigenvalues and symmetric matrices and Lecture 5 on positive definite matrices first, since the SVD is built directly from the fact that A^T A is symmetric positive semidefinite.
  • Comfort with the spectral theorem S = QΛQ^T is assumed throughout.

Check your understanding

  1. Why can't a rectangular matrix have eigenvalues in the usual sense, and what replaces them in the SVD?
  2. How do the eigenvectors of A^T A become the right singular vectors V, and where do the singular values come from?
  3. What is the key step in proving that the vectors U_i = A V_i / σ_i are orthogonal to each other?
  4. What does each of the three factors U, Σ, and V^T do geometrically to a unit circle?
  5. How does the polar decomposition A = SQ follow directly from the SVD?

Vocabulary

singular value decomposition (noun)
A way to break any matrix into a rotation, a stretch, and another rotation.
The singular value decomposition works for every matrix, even rectangular ones.
singular value (noun)
A positive number that measures how much a matrix stretches in one particular direction.
The singular values sit on the diagonal of Sigma.
singular vector (noun)
One of the special input or output directions used in the singular value decomposition.
V holds the right singular vectors and U holds the left ones.
rectangular matrix (noun)
A matrix with a different number of rows than columns.
A rectangular matrix has no ordinary eigenvalues.
replacement (noun)
Something used in place of another thing.
Singular vectors are the replacement for eigenvectors in a rectangular matrix.
positive semidefinite (adjective)
Describes a symmetric matrix whose eigenvalues are all zero or positive.
A^T A is always positive semidefinite.
crucially (adverb)
In a way that is extremely important.
Crucially, the U vectors turn out to be orthogonal.
rotate, stretch, rotate (phrase)
A description of what a matrix does geometrically: turn, then stretch, then turn again.
The SVD gives the rotate, stretch, rotate picture of a matrix.
degrees of freedom (noun)
The number of independent values needed to fully describe something.
A 2x2 matrix has 4 degrees of freedom, matching its SVD parameters.
parameter (noun)
A number that can be adjusted or that describes part of a system.
Strang counts the parameters in each factor of the SVD.
polar decomposition (noun)
Writing a matrix as a symmetric matrix times an orthogonal matrix.
The polar decomposition parallels writing a complex number as size times direction.
analog (noun)
Something similar to another thing in a different setting.
The polar decomposition is the matrix analog of a complex number's magnitude and angle.
rank-one piece (noun)
A simple matrix built from just one input vector and one output vector.
Sigma1 times u1 times v1 transpose is the leading rank-one piece.
principal component (noun)
A direction in data that captures the most variation, found using the SVD.
The leading rank-one piece sets up principal component analysis.
column space (noun)
The set of all vectors you can reach by combining a matrix's columns.
AA^T's eigenvectors relate to the column space of A.
row space (noun)
The set of all vectors you can reach by combining a matrix's rows.
V vectors come from the row space side of A.
numerical linear algebra (noun)
The study of how to compute matrix operations accurately and efficiently on a computer.
Numerical linear algebra avoids forming A^T A directly.
rounding error (noun)
A small mistake that happens because a computer stores numbers with limited precision.
Forming A^T A directly increases rounding error.
substitute (verb)
To put one thing in place of another.
Strang substitutes A = U Sigma V^T back into A^T A to check the formula.
vector (noun)
A list of numbers representing a direction and size.
Each singular vector is a unit-length vector.
stretch (verb)
To make something longer along a given direction.
Sigma stretches the circle into an ellipse.
key fact (noun)
The single most important piece of reasoning that makes an argument work.
Orthogonality of the U vectors is the key fact behind the SVD.

Chapters

From the YouTube description

MIT 18.065 Matrix Methods in Data Analysis, Signal Processing, and Machine Learning, Spring 2018
Instructor: Gilbert Strang
View the complete course: https://ocw.mit.edu/18-065S18
YouTube Playlist: https://www.youtube.com/playlist?list=PLUl4u3cNGP63oMNUHXqIUcrkS2PivhN3k

Singular Value Decomposition (SVD) is the primary topic of this lecture. Professor Strang explains and illustrates how the SVD separates a matrix into rank one pieces, and that those pieces come in order of importance.

License: Creative Commons BY-NC-SA
More information at https://ocw.mit.edu/terms
More courses at https://ocw.mit.edu

← Lecture 5: Positive Definite and Semidefinite Matrices · Lecture 7: Eckart-Young, the Closest Rank k Matrix to A →