Every matrix is a rotation, a stretch and a rotation
Eigendecomposition needs a square matrix, and even then it can fail. The singular value decomposition works for every matrix, rectangular or not: with and orthogonal and diagonal with non-negative entries , the singular values. Geometrically first rotates by , then stretches each axis by , then rotates by . A unit circle becomes an ellipse whose semi-axes are the singular values.
The columns of are the eigenvectors of and the columns of are the eigenvectors of , with eigenvalues . So the SVD is the spectral theorem applied to , but computed without ever forming that product, which would square the condition number and lose half the digits. Reading off facts is easy: the rank is the number of non-zero singular values, is the largest stretch, the Frobenius norm squared is the sum of the squared singular values, for a square matrix, and the condition number measures how much can amplify errors. For a data matrix with , the full is , is and is .
- SVD: every matrix is with orthogonal , and non-negative sorted singular values.
- Facts: rank is the count of non-zero , , .
- Condition number: ; a large value means unstable solves and unreliable inverses.
If is a matrix of demeaned returns, its covariance is , so the right singular vectors of are the principal directions and are the variances along them. Taking the SVD of directly gives PCA more accurately than eigendecomposing the covariance matrix, and it works even when .
Lab · what's graded
7 tasks · 100 pts- The largest singular value20 pts
- The Frobenius identity10 pts
- The product of singular values10 pts
- Shapes of a full SVD15 pts
- Singular values and eigenvalues15 pts
- A condition number15 pts
- Why not eigendecompose AᵀA15 pts