Singular Value Decomposition

Formal
SVD

Let ARm×nA\in \mathbb{R}^{m\times n} be a rectangular matrix of rank r[0,min(m,n)]r\in[0, \min(m,n)]. The SVD of AA is a decomposition of the form

A=UΣVT(1)A=U\Sigma V^T \tag {1}

svd with an orthogonal matrix URm×mU \in \mathbb{R}^{m\times m} with column vectors ui,i=1,,mu_{i}, i=1,\dots,m and an orthogonal matrix URn×nU \in \mathbb{R}^{n\times n} with column vectors vj,j=1,,nv_{j}, j=1,\dots,n. Moreover, Σ\Sigma is an m×nm \times n with Σii=σi0\Sigma_{ii}=\sigma_{i} \geq 0 and Σij=0,ij\Sigma_{ij}=0, i\ne j. The diagonal entries σi,i=1,,r,\sigma_{i}, i=1,\dots,r, of Σ\Sigma are called singular values, uiu_{i} are called left-singular vectors and vjv_{j} are called right-singular vectors. By convention, the singular values are ordered, i.e., σ1σ2σr0\sigma_{1} \ge \sigma_{2}\geq \sigma_{r} \ge 0.

SVD exists for every matrix ARm×nA \in \mathbb{R}^{m\times n}.

Construction of SVD

The construction of the Singular Value Decomposition (SVD) for any rectangular matrix AA is based on the properties of two related symmetric matrices: ATAA^TA and AATAA^T. The process involves finding the eigenvalues and eigenvectors of these matrices, which in turn define the components of the SVD. 1. Find the Right-Singular Vector (VV) and Singular Values (Σ\Sigma) Compute the eigendecomposition of matrix ATAA^TA.

  • Construct ATAA^TA. This is guaranteed to be an SPD matrix. (Symmetric, Positive Definite Matrices) which implies that its Eigenvalues are real and non-negative, and its eigenvectors form an orthonormal basis.
  • Eigendecomposition: Find the eigenvalues λi\lambda_{i} and the corresponding orthonormal eigenvectors.
    • The right-singular vectors (viv_{i}) in SVD of AA are the eigenvectors of ATAA^TA. These vectors form the columns of the orthogonal matrix VV.
    • The singular values (σi\sigma_{i}) of the SVD of AA are the square root of the eigenvalues of ATAA^TA. These form the diagonal matrix Σ\Sigma. These come from the substitution of SVD formula into the expression for ATAA^TA:
ATA=(UΣVT)T(UΣVT)=VΣTUTUΣVT=V(ΣTΣ)VT.A^TA=(U\Sigma V^T)^T(U\Sigma V^T)=V\Sigma^TU^TU\Sigma V^T=V(\Sigma^T\Sigma) V^T.

2. Find the Left-Singular Vectors U Similar to the first step, the left-singular vectors (uiu_i) of A are the orthonormal eigenvectors of the matrix AATAA^T. The eigenvalues of AATAA^T are also equal to σi2\sigma_i^2.

Intuition

At its heart, the SVD tells us that every linear transformation can be broken down into a sequence of three simple geometric operations: a rotation, a scaling, and another rotation. This holds true for any rectangular matrix A, making SVD a universally applicable tool.

A beautiful way to visualize this comes from observing how a matrix AA transforms a set of unit vectors (Column View of a System of Linear Equations) . Imagine a circle of unit vectors in your input space. Applying the matrix A will transform this circle into an ellipse in the output space. The SVD elegantly describes this transformation:

  • The right-singular vectors (viv_i) are the special, orthonormal vectors on the original unit circle that get mapped directly onto the principal axes of the output ellipse. They represent the principal directions of the input space.
  • The left-singular vectors (uiu_i) are the orthonormal unit vectors that define the directions of the principal axes of the output ellipse. They represent the principal directions of the output space.
  • The singular values (σi\sigma_i) are the lengths of these principal axes. Each σi\sigma_i is the scaling factor applied to its corresponding vector viv_i to map it to an axis of length σi in the direction of uiu_i.

This fundamental relationship, Avi=σiuiAv_i=\sigma_iu_i, is the core geometric insight of SVD. It shows that the complex action of a matrix A can be understood as finding an orthonormal basis in the input space (VV) that maps to an orthogonal (but scaled) basis in the output space (σiui\sigma_i u_{i}).

The full decomposition A=UΣVTA=U\Sigma V^T operationalizes this as a three-step process, as shown in the diagram above

  1. VTV^T (First Rotation): Aligns the principal input directions (viv_i) with the standard coordinate axes.
  2. Σ\Sigma (Scaling): Scales the space along these axes by the singular values σi. This is also where dimensionality might change (e.g., from RnRm\mathbb{R}^n \rightarrow \mathbb{R}^m).
  3. UU (Second Rotation): Orients the scaled result to its final position in the output space.
ML Applications

SVD is a fundamental tool with broad applications in machine learning, primarily due to its ability to find optimal low-rank approximations.

  • Principal Component Analysis (PCA) and Dimensionality Reduction: SVD provides the most direct way to perform PCA. The Eckart-Young Theorem states that the best rank-kk approximation of a matrix AA is found by truncating its SVD to the top kk singular values. This truncated SVD, A~(k)=UkΣkVkT\tilde{A}(k)=U_k\Sigma_kV_k^T, minimizes the reconstruction error. In PCA, the columns of UkU_k (the first kk left-singular vectors) form the basis of the principal subspace that best captures the data’s variance.
  • Recommender Systems: SVD can uncover latent (hidden) factors in data. In the movie-rating example (Example 4.14), SVD decomposes the user-movie matrix into vectors that represent abstract concepts like “sci-fi lover” or “art-house film,” allowing for powerful recommendations based on these latent features.
  • Numerical Stability: SVD is the preferred method for solving linear systems of equations and computing the pseudo-inverse, especially for ill-conditioned or non-square matrices.
Connections
  • #type/concept
  • #matrix-decomposition
  • #svd