Definition
Let A ∈ R m × n A \in \mathbb{R}^{m \times n} A ∈ R m × n with r = rank ( A ) r = \operatorname{rank}(A) r = rank ( A ) . A singular value decomposition (SVD) of A A A is a factorization
A = U Σ V ⊤ A = U \Sigma V^\top A = U Σ V ⊤ with an orthogonal U ∈ R m × m U \in \mathbb{R}^{m \times m} U ∈ R m × m (U ⊤ U = I m U^\top U = I_m U ⊤ U = I m ), an orthogonal V ∈ R n × n V \in \mathbb{R}^{n \times n} V ∈ R n × n (V ⊤ V = I n V^\top V = I_n V ⊤ V = I n ) and a rectangular diagonal Σ ∈ R m × n \Sigma \in \mathbb{R}^{m \times n} Σ ∈ R m × n with Σ i i = σ i \Sigma_{ii} = \sigma_i Σ ii = σ i and Σ i j = 0 \Sigma_{ij} = 0 Σ ij = 0 for i ≠ j i \neq j i = j , where
σ 1 ≥ σ 2 ≥ ⋯ ≥ σ r > 0 = σ r + 1 = … \sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r > 0 = \sigma_{r+1} = \dots σ 1 ≥ σ 2 ≥ ⋯ ≥ σ r > 0 = σ r + 1 = … The σ i \sigma_i σ i are the singular values , the columns u i u_i u i of U U U the left-singular vectors and the columns v j v_j v j of V V V the right-singular vectors . Every real matrix has an SVD (MML Thm. 4.22).
Reduced (compact) SVD. Dropping the zero singular values and the vectors they multiply gives
A = U r S V r ⊤ , U r ∈ R m × r , S = diag ( σ 1 , … , σ r ) ∈ R r × r , V r ∈ R n × r , A = U_r S V_r^\top, \qquad U_r \in \mathbb{R}^{m \times r},\; S = \operatorname{diag}(\sigma_1, \dots, \sigma_r) \in \mathbb{R}^{r \times r},\; V_r \in \mathbb{R}^{n \times r}, A = U r S V r ⊤ , U r ∈ R m × r , S = diag ( σ 1 , … , σ r ) ∈ R r × r , V r ∈ R n × r , where U r U_r U r and V r V_r V r are column-orthonormal (U r ⊤ U r = V r ⊤ V r = I r U_r^\top U_r = V_r^\top V_r = I_r U r ⊤ U r = V r ⊤ V r = I r ) and S S S is invertible.
! Conventions differ
The DBIS/IR exams mostly write the reduced SVD as A = U ⋅ S ⋅ V A = U \cdot S \cdot V A = U ⋅ S ⋅ V with V : = V r ⊤ ∈ R r × n V := V_r^\top \in \mathbb{R}^{r \times n} V := V r ⊤ ∈ R r × n , which is then row-orthonormal (V V ⊤ = I r V V^\top = I_r V V ⊤ = I r ). Some exams (WS 17/18, WS 19/20) and MSI use A = U S V ⊤ A = U S V^\top A = U S V ⊤ . Check which one a task uses before transposing anything.
Construction from eigenvectors (MML §4.5.2). Inserting the SVD into the two Gram matrices:
A ⊤ A = V Σ ⊤ Σ V ⊤ , A A ⊤ = U Σ Σ ⊤ U ⊤ . A^\top A = V\, \Sigma^\top \Sigma\, V^\top, \qquad A A^\top = U\, \Sigma \Sigma^\top\, U^\top. A ⊤ A = V Σ ⊤ Σ V ⊤ , A A ⊤ = U Σ Σ ⊤ U ⊤ . Both are symmetric and positive semidefinite, so:
the right-singular vectors v i v_i v i are orthonormal eigenvectors of A ⊤ A A^\top A A ⊤ A , the left-singular vectors u i u_i u i are orthonormal eigenvectors of A A ⊤ A A^\top A A ⊤ , the nonzero eigenvalues of both are λ i = σ i 2 \lambda_i = \sigma_i^2 λ i = σ i 2 , so σ i = λ i \sigma_i = \sqrt{\lambda_i} σ i = λ i . The two sides are linked by
u i = 1 σ i A v i , v i = 1 σ i A ⊤ u i ( i ≤ r ) , i.e. V r ⊤ = S − 1 U r ⊤ A . u_i = \frac{1}{\sigma_i} A v_i, \qquad v_i = \frac{1}{\sigma_i} A^\top u_i \quad (i \le r), \qquad\text{i.e.}\qquad V_r^\top = S^{-1} U_r^\top A. u i = σ i 1 A v i , v i = σ i 1 A ⊤ u i ( i ≤ r ) , i.e. V r ⊤ = S − 1 U r ⊤ A . Outer-product form:
A = ∑ i = 1 r σ i u i v i ⊤ , A = \sum_{i=1}^{r} \sigma_i\, u_i v_i^\top, A = i = 1 ∑ r σ i u i v i ⊤ , a sum of r r r rank-1 matrices weighted by the singular values (MML (4.91)).
Rank-k k k approximation (truncated SVD). For k ≤ r k \le r k ≤ r keep the k k k largest singular values:
A k = U k S k V k ⊤ = ∑ i = 1 k σ i u i v i ⊤ , A_k = U_k S_k V_k^\top = \sum_{i=1}^{k} \sigma_i\, u_i v_i^\top, A k = U k S k V k ⊤ = i = 1 ∑ k σ i u i v i ⊤ , with U k U_k U k , V k V_k V k the first k k k columns of U U U , V V V and S k = diag ( σ 1 , … , σ k ) S_k = \operatorname{diag}(\sigma_1, \dots, \sigma_k) S k = diag ( σ 1 , … , σ k ) . Storing A k A_k A k in factored form takes k ( m + n + 1 ) k(m + n + 1) k ( m + n + 1 ) numbers instead of m n mn mn .
Theorem Eckart–Young (MML Thm. 4.25)
For every B ∈ R m × n B \in \mathbb{R}^{m \times n} B ∈ R m × n with rank ( B ) ≤ k \operatorname{rank}(B) \le k rank ( B ) ≤ k :
∥ A − A k ∥ 2 = σ k + 1 ≤ ∥ A − B ∥ 2 , \|A - A_k\|_2 = \sigma_{k+1} \le \|A - B\|_2, ∥ A − A k ∥ 2 = σ k + 1 ≤ ∥ A − B ∥ 2 , where ∥ M ∥ 2 = max x ≠ 0 ∥ M x ∥ 2 / ∥ x ∥ 2 \|M\|_2 = \max_{x \neq 0} \|Mx\|_2 / \|x\|_2 ∥ M ∥ 2 = max x = 0 ∥ M x ∥ 2 /∥ x ∥ 2 is the spectral norm, which equals the largest singular value of M M M (MML Thm. 4.24). So A k A_k A k is the best rank-k k k approximation of A A A .
Properties# Rank: rank ( A ) \operatorname{rank}(A) rank ( A ) = number of nonzero singular values (Matrix Rank ).Uniqueness: the singular values are unique. If they are pairwise distinct, each u i u_i u i , v i v_i v i is unique up to a common sign flip.U ⊤ U U^\top U U ⊤ U vs. U U ⊤ U U^\top U U ⊤ : for the reduced U r ∈ R m × r U_r \in \mathbb{R}^{m \times r} U r ∈ R m × r , U r ⊤ U r = I r U_r^\top U_r = I_r U r ⊤ U r = I r always holds (orthonormal columns). U r U r ⊤ ∈ R m × m U_r U_r^\top \in \mathbb{R}^{m \times m} U r U r ⊤ ∈ R m × m has rank r r r , so it equals I m I_m I m only if r = m r = m r = m . In general U r U r ⊤ U_r U_r^\top U r U r ⊤ is the orthogonal projection onto the column space im ( A ) \operatorname{im}(A) im ( A ) .Inverting the factorization: since U r ⊤ U r = I r U_r^\top U_r = I_r U r ⊤ U r = I r and S S S is invertible, A = U r S V r ⊤ A = U_r S V_r^\top A = U r S V r ⊤ gives V r ⊤ = S − 1 U r ⊤ A V_r^\top = S^{-1} U_r^\top A V r ⊤ = S − 1 U r ⊤ A (DBIS notation: V = S − 1 U ⊤ A V = S^{-1} U^\top A V = S − 1 U ⊤ A ).Symmetric PSD matrices: for A = A ⊤ ≽ 0 A = A^\top \succcurlyeq 0 A = A ⊤ ≽ 0 the SVD is the eigendecomposition, U = V U = V U = V and σ i = λ i \sigma_i = \lambda_i σ i = λ i (MML p. 123).Pseudo inverse: A + = V r S − 1 U r ⊤ A^+ = V_r S^{-1} U_r^\top A + = V r S − 1 U r ⊤ (MSI script Def. 10).Example# Sources# MML p. 119 (Thm. 4.22: SVD theorem, singular values and vectors), MML pp. 122–125 (§4.5.2: construction from A ⊤ A A^\top A A ⊤ A and A A ⊤ AA^\top A A ⊤ , σ i 2 = λ i \sigma_i^2 = \lambda_i σ i 2 = λ i , u i = A v i / σ i u_i = Av_i/\sigma_i u i = A v i / σ i )MML p. 129 (reduced SVD, truncated SVD, rank-1 matrices u i v i ⊤ u_i v_i^\top u i v i ⊤ ), MML p. 130 (outer-product form (4.91), rank-k k k approximation), MML pp. 131–132 (spectral norm, Thm. 4.24, Eckart–Young Thm. 4.25)Use in DBIS: Latent Semantic Indexing (rank-k k k approximation of the term-document matrix, LSI Ranking ); exams WS 16/17 Task 5 (not published) , WS 17/18 Task 5 (not published) , WS 19/20 Task 5.1 (not published) , WS 22/23 Task 5.2 (not published) Use in MSI: MSI script p. 34 (Def. 9: SVD, Def. 10: Moore–Penrose pseudo inverse)