core21 min studyLesson 14 in Mathematics

Singular value decomposition

Factor any finite real matrix into orthogonal directions and nonnegative stretches, then quantify approximation error.

Before you begin
On this page

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 mm by nn matrix, a full SVD writes the map as UΣVTU\Sigma V^T. The columns of VV are orthonormal input directions and the columns of UU are orthonormal output directions. The rectangular diagonal matrix Σ\Sigma contains nonnegative singular values. Reading from right to left, first express the input in the VV basis, then stretch each coordinate, and finally express the output in the original coordinates using UU.

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.

A=UΣVT,UTU=Im,VTV=In,Avi=σiuiA=U\Sigma V^T,\qquad U^TU=I_m,\quad V^TV=I_n,\quad Av_i=\sigma_i u_i
For a full real SVD, U is m×m, V is n×n, and Σ is m×n. The paired relation holds for the matched singular directions; each σᵢ is nonnegative.↔ Scroll wide equations horizontally.

Connect stretching to eigenvalues

The matrix ATAA^TA 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 xTATAx=∥Ax∥2x^TA^TAx=\|Ax\|^2 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 ATAA^TA when accuracy matters, since doing so squares the condition number.

ATAvi=σi2vi,∥A∥F2=∑iσi2A^TAv_i=\sigma_i^2v_i,\qquad \|A\|_F^2=\sum_i\sigma_i^2
The first relation holds for real singular vectors. The Frobenius norm is the square root of the sum of squared matrix entries, so squared singular values partition that norm's squared total.↔ Scroll wide equations horizontally.

Approximation makes a controlled tradeoff

Order singular values from largest to smallest. Keeping the first kk terms gives a rank-at-most-kk 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.

Compress two independent stretches

For A=(3001)A=\begin{pmatrix}3&0\\0&1\end{pmatrix}, find the best rank-one approximation and its Frobenius error.

  1. The matrix is already diagonal with nonnegative descending entries, so take U=V=IU=V=I and singular values σ1=3\sigma_1=3, σ2=1\sigma_2=1.

  2. Keep the first singular term and remove the second: A1=(3000)A_1=\begin{pmatrix}3&0\\0&0\end{pmatrix}. Its image lies on one axis, confirming rank one.

  3. The residual contains only the omitted entry 1, so ∥A−A1∥F=1\|A-A_1\|_F=1. The original squared norm is 32+12=103^2+1^2=10, of which the approximation retains 9.

The result

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.

Explore the model

Interactive lab

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.

Compare directions and stretchingPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

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.

Check your understanding

What are the singular values of the real matrix diag(3,−2)?

Try it yourself

A matrix has singular values 5,2,15,2,1. 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 25+4+1=3025+4+1=30. Keeping the two largest values retains 29/30≈96.7%29/30\approx96.7\%. The discarded squared norm is 11, so the Frobenius residual is 11, not 1/301/30. The percentage and the absolute error answer different questions.

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.