Math & Statistics

Singular Value Decomposition

Factoring any rectangular matrix into rotation, scaling, and orthogonal basis matrices.

🔴 advanced5 min readlinear-algebra
Singular Value Decomposition (SVD) is the foundational matrix factorization technique in linear algebra. SVD factorizes ANY real matrix A (m × n) into three matrices: A = U Σ V^T, where U is an m × m orthogonal matrix of left-singular vectors, Σ is an m × n diagonal matrix of non-negative singular values, and V^T is an n × n orthogonal matrix of right-singular vectors. Truncated SVD provides the mathematically optimal low-rank matrix approximation (Eckart-Young-Mirsky Theorem), forming the backbone of PCA, image compression, and Latent Semantic Analysis (LSA).

The Fundamental SVD Equation

Every real m×nm \times n matrix AA can be factored as:

A = U * Sigma * V^T

  Matrix A (m × n)          Left Vectors U (m × m)    Singular Values Σ (m × n)   Right Vectors V^T (n × n)
  ┌──────────────┐          ┌──────────────┐          ┌───┬───┬───┐               ┌──────────────┐
  │              │    =     │              │    ×     │σ1 │ 0 │ 0 │       ×       │              │
  │              │          │              │          ├───┼───┼───┤               │              │
  └──────────────┘          └──────────────┘          └───┴───┴───┘               └──────────────┘
  1. Left-Singular Vectors U (m × m): Orthogonal matrix (UTU=IU^T U = I). Columns are eigenvectors of AATA A^T.
  2. Singular Values Sigma (m × n): Diagonal matrix. Values σ1≥σ2≥⋯≥σr>0\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r > 0 are square roots of eigenvalues of ATAA^T A.
  3. Right-Singular Vectors V^T (n × n): Orthogonal matrix (VTV=IV^T V = I). Columns of VV are eigenvectors of ATAA^T A.

Geometric Interpretation: Three Transformations

SVD breaks down any linear transformation into three geometric steps:

  1. V^T: Rotate the input vector space.
  2. Sigma: Scale along orthogonal axes by singular values σi\sigma_i.
  3. U: Rotate into the output vector space.
  Unit Circle x ──► [ Rotate V^T ] ──► [ Stretch Σ by σ1, σ2 ] ──► [ Rotate U ] ──► Ellipse Ax

Truncated SVD & Image Compression

To compress a matrix AA to rank k≪min⁡(m,n)k \ll \min(m, n):

Keep only the top kk largest singular values:

A_k = sum_{i=1}^k \sigma_i u_i v_i^T

The Eckart-Young-Mirsky Theorem proves that AkA_k is the mathematically optimal rank-kk approximation of AA, minimizing Frobenius norm error ∥A−Ak∥F\|A - A_k\|_F.

Key Machine Learning Applications

  1. Principal Component Analysis (PCA): Compute SVD on mean-centered matrix XX. The right-singular vectors VV are the principal components.
  2. Latent Semantic Analysis (LSA): Apply SVD to term-document matrices to discover hidden semantic concepts in text collections.
  3. Recommender Systems: Decompose sparse rating matrices for collaborative filtering.

Say this out loud

SVD factorizes any matrix A into U Sigma V^T, where U and V are orthogonal rotation matrices and Sigma contains non-negative singular values. Truncated SVD keeps the top k singular values to give the optimal low-rank matrix approximation under the Eckart-Young theorem. SVD forms the mathematical engine behind PCA, dimensional reduction, and latent semantic analysis.

Follow-ups to expect

Check yourself

Question 1 of 3

What is the formal matrix factorization equation for SVD of an m × n real matrix A?

More in Math & Statistics

See all →
Bayes’ Theorem4 minCentral Limit Theorem4 minLaw of Large Numbers4 min