Skip to content

Singular value decomposition, intuitively

6 min read

Short answer

Every matrix AA (any shape) factors as A=UΣVTA=U\Sigma V^T, where UU and VV have orthonormal columns and Σ\Sigma is diagonal with the singular values σ1≥σ2≥⋯≥0\sigma_1\ge\sigma_2\ge\dots\ge0. Geometrically: rotate (VTV^T), stretch along the coordinate axes by the σ\sigma's (Σ\Sigma), then rotate again (UU). Taking square roots of the eigenvalues of ATAA^TA gives the singular values.

Steps1Vᵀ: rotate so the key inputdirections line up with the axes2Σ: stretch each axis by its singular value σ3U: rotate into the final output directionsLarge σ = important direction; σ ≈ 0 = nearly lost
Any linear map turns a circle into an ellipse. The singular values are the ellipse's semi-axis lengths.

How to compute it

  1. Form ATAA^TA and find its eigenvalues σi2\sigma_i^2 and orthonormal eigenvectors (the columns of VV).
  2. Singular values are σi=λi\sigma_i=\sqrt{\lambda_i}.
  3. Columns of UU are ui=Avi/σi\mathbf u_i=A\mathbf v_i/\sigma_i.

The number of nonzero singular values is the rank of AA.

Why people use it

Keeping only the largest few singular values gives the best low-rank approximation of a matrix, which powers image compression, noise reduction, recommendation systems and principal component analysis. For a square matrix, ∣det⁡A∣=σ1σ2⋯σn|\det A|=\sigma_1\sigma_2\cdots\sigma_n.

Worked example

Find the singular values of A=(3045)A=\begin{pmatrix}3&0\\4&5\end{pmatrix}.

ATA=(25202025)A^TA=\begin{pmatrix}25&20\\20&25\end{pmatrix} (columns (3,4)(3,4) and (0,5)(0,5) give 25, 20, 2525,\ 20,\ 25).

Its eigenvalues are 25±20=4525\pm20=45 and 55, with eigenvectors 12(1,1)\tfrac1{\sqrt2}(1,1) and 12(1,−1)\tfrac1{\sqrt2}(1,-1).

So σ1=45=35\sigma_1=\sqrt{45}=3\sqrt5 and σ2=5\sigma_2=\sqrt5.

Check: σ1σ2=15=∣det⁡A∣=∣3⋅5−0⋅4∣\sigma_1\sigma_2=15=|\det A|=|3\cdot5-0\cdot4|. ✓

Try it yourself

What are the singular values of (0200)\begin{pmatrix}0&2\\0&0\end{pmatrix}, and what is its rank?

Show the answer

For ATA=(0004)A^TA=\begin{pmatrix}0&0\\0&4\end{pmatrix} the eigenvalues are 44 and 00, which means the singular values are 22 and 00. Only one is nonzero, so the rank is 1.

Keep going with practice

Singular values build on eigenvalues and orthogonality in Vidi's Linear Algebra & Probability course.