Singular value decomposition
Factor any finite real matrix into orthogonal directions and nonnegative stretches, then quantify approximation error.
On this page
The question for today
What you’ll understand
- Explain input and output singular directions.
- Distinguish singular values from signed eigenvalues.
- Calculate retained energy and error for a truncated decomposition.
Eigenvectors describe a square map's invariant directions. A rectangular matrix may connect different-dimensional spaces, so singular value decomposition instead finds paired input and output directions. Between those orthogonal coordinate systems, the transformation is independent stretching. This supplies a common language for compression, least squares, conditioning, and data geometry without requiring invertibility.
Rotate, stretch, rotate
For a real by matrix, a full SVD writes the map as . The columns of are orthonormal input directions and the columns of are orthonormal output directions. The rectangular diagonal matrix contains nonnegative singular values. Reading from right to left, first express the input in the basis, then stretch each coordinate, and finally express the output in the original coordinates using .
Orthogonal factors can include reflections as well as rotations. Their role is to preserve Euclidean lengths while the singular values carry the stretches. This is why a negative matrix eigenvalue does not become a negative singular value: its sign can be carried by an orthogonal direction instead. The decomposition exists for every finite real matrix, although signs and bases inside repeated singular-value subspaces are not unique.
Connect stretching to eigenvalues
The matrix is symmetric and positive semidefinite. Its orthonormal eigenvectors provide the right singular directions, and its eigenvalues are the squared singular values. Positive semidefinite means that cannot be negative. This argument explains both the appearance of squares and the absence of negative singular values without relying on a decomposition recipe alone.
A very small singular value signals an input direction that barely affects the output. Attempting to invert that stretch magnifies measurement noise. The ratio of largest to smallest positive singular values describes conditioning on the identifiable subspace; for an invertible square matrix it gives the usual spectral condition number. Actual numerical software generally avoids explicitly forming when accuracy matters, since doing so squares the condition number.
Approximation makes a controlled tradeoff
Order singular values from largest to smallest. Keeping the first terms gives a rank-at-most- matrix that minimizes Frobenius error among matrices of that rank bound. Its squared error is the sum of the omitted squared singular values. This is a precise guarantee about a chosen norm, not a guarantee that every task-relevant detail survives. A faint feature can be important even if it contributes little numerical energy.
For centered data, principal component analysis uses right singular vectors as directions of variation. Centering matters: otherwise a large average offset can dominate the decomposition. SVD also appears in quantum bipartite-state decompositions, but interpreting those coefficients requires normalized complex amplitudes and tensor-product structure. Here the achievement is narrower and concrete: we can name how much a finite real matrix stretches each orthogonal input direction and what a low-rank approximation discards.
Work it through
Compress two independent stretches
For , find the best rank-one approximation and its Frobenius error.
The matrix is already diagonal with nonnegative descending entries, so take and singular values , .
Keep the first singular term and remove the second: . Its image lies on one axis, confirming rank one.
The residual contains only the omitted entry 1, so . The original squared norm is , of which the approximation retains 9.
The best rank-one approximation retains 90% of the squared Frobenius norm. It completely loses the second direction despite retaining most of this numerical energy.
The living notebook
Explore the model
Interactive lab · vectors
Compare directions and stretching
Vary angle and magnitude, then inspect the vector's x/y projections. Picture an individual direction and stretch while keeping those two concepts separate. The lab shows one vector; it does not transform a unit circle, compute a matrix SVD, or calculate approximation error.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forOrthogonal directions organize the geometry, while singular values measure nonnegative stretches.
Pause & reason
Check your understanding
Your turn
Try it yourself
A matrix has singular values . What fraction of squared Frobenius norm does its rank-two truncation retain, and what is the residual norm?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Sum squared values for the energy fraction; take the square root of the omitted sum for the residual norm.
Compare with the solution
The original squared norm is . Keeping the two largest values retains . The discarded squared norm is , so the Frobenius residual is , not . The percentage and the absolute error answer different questions.
Keep the idea
Take it with you
- SVD exists even for rectangular or singular finite real matrices.
- Singular values describe nonnegative stretches, not signed eigenvalues.
- Truncation gives an optimal error in a specified norm, not automatic task preservation.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.