Singular Value Decomposition (matrix factorization)
Singular Value Decomposition The SVD is a factorization of a ๐ร๐ matrix into ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ where ๐ฝ is a ๐ร๐ orthogonal matrix, ๐พ ๐ผ is a ๐ร๐ orthogonal matrix and ๐ป is a ๐ร๐ diagonal matrix. For a square matrix ( ๐ = ๐): ๐ & โฅ ๐ ) โฅ ๐ * โฆ ( ๐ & โฎ โฆ โฎ โฆ ๐ฐ & โฆ ๐ฉ = ๐ & โฆ ๐ ' โฎ โฎ โฎ โฑ ( โฎ โฆ โฎ โฆ ๐ฐ ' โฆ ๐ ' ( ๐ & โฎ โฆ โฎ โฎ โฆ โฎ ๐ฉ = ๐ & โฆ ๐ ' ๐ & โฆ ๐ ' โฑ โฎ โฆ โฎ โฎ โฆ โฎ ๐ '
Reduced SVD What happens when ๐ฉ is not a square matrix? 1) ๐ > ๐ ๐ " โฑ % โฎ โฆ โฎ โฆ โฎ โฆ ๐ฐ " โฆ ๐ # ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ = ๐ " โฆ ๐ # โฆ ๐ $ โฎ โฎ โฎ 0 % โฎ โฆ โฎ โฆ โฎ โฆ ๐ฐ # โฆ โฎ 0 ๐ร๐ ๐ร๐ ๐ร๐ We can instead re-write the above as: ๐ฉ = ๐ฝ ๐บ ๐ป ๐บ ๐พ ๐ผ Where ๐ฝ ๐บ is a ๐ร๐ matrix and ๐ป ๐บ is a ๐ร๐ matrix
Reduced SVD 2) ๐ > ๐ % โฆ ๐ฐ " โฆ ๐ & 0 โฎ โฎ โฎ โฎ โฆ โฎ ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ = % โฑ โฑ โฆ ๐ฐ $ โฆ ๐ " โฆ ๐ # ๐ . 0 โฎ โฎ โฎ โฎ โฆ โฎ % โฆ ๐ฐ # โฆ ๐ร๐ ๐ร๐ ๐ร๐ We can instead re-write the above as: ๐ผ ๐ฉ = ๐ฝ ๐ป ๐บ ๐พ ๐บ where ๐พ ๐บ is a ๐ร๐ matrix and ๐ป ๐บ is a ๐ร๐ matrix In general: ๐ฝ ๐บ is a ๐ร๐ matrix ๐ผ ๐ฉ = ๐ฝ ๐บ ๐ป ๐บ ๐พ ๐บ ๐ = min(๐, ๐) ๐ป ๐บ is a ๐ ร๐ matrix ๐พ ๐บ is a ๐ร๐ matrix
Letโs take a look at the product ๐ป ๐ผ ๐ป, where ๐ป has the singular values of a ๐ฉ , a ๐ร๐ matrix. ๐ " โฑ ๐ "$ ๐ " 0 ๐ # ๐ป ๐ผ ๐ป = = โฑ โฑ โฑ 0 ๐ #$ ๐ # 0 โฎ 0 ๐ > ๐ ๐ร๐ ๐ร๐ ๐ร๐ ๐ "$ ๐ " 0 โฑ โฑ โฑ ๐ " 0 ๐ %$ ๐ % 0 ๐ป ๐ผ ๐ป = = โฑ โฑ 0 0 0 ๐ % 0 โฎ โฑ โฑ 0 0 0 ๐ร๐ ๐ > ๐ ๐ร๐ ๐ร๐
Assume ๐ฉ with the singular value decomposition ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ . Letโs take a look at the eigenpairs corresponding to ๐ฉ ๐ผ ๐ฉ: ๐ฉ ๐ผ ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ ๐ผ ๐ฝ ๐ป ๐พ ๐ผ ๐พ ๐ผ ๐ผ ๐ป ๐ผ ๐ฝ ๐ผ ๐ฝ ๐ป ๐พ ๐ผ = ๐พ๐ป ๐ผ ๐ฝ ๐ผ ๐ฝ ๐ป ๐พ ๐ผ = ๐พ ๐ป ๐ผ ๐ป ๐พ ๐ผ Hence ๐ฉ ๐ผ ๐ฉ = ๐พ ๐ป ๐ ๐พ ๐ผ Recall that columns of ๐พ are all linear independent (orthogonal matrix), then from diagonalization ( ๐ช = ๐๐ฌ๐ 1๐ ), we get: โข the columns of ๐พ are the eigenvectors of the matrix ๐ฉ ๐ผ ๐ฉ โข The diagonal entries of ๐ป ๐ are the eigenvalues of ๐ฉ ๐ผ ๐ฉ Letโs call ๐ the eigenvalues of ๐ฉ ๐ผ ๐ฉ, then ๐ 3) = ๐ 3
In a similar way, ๐ฝ ๐ป ๐พ ๐ผ ๐ผ ๐ฉ๐ฉ ๐ผ = ๐ฝ ๐ป ๐พ ๐ผ ๐พ ๐ผ ๐ผ ๐ป ๐ผ ๐ฝ ๐ผ = ๐ฝ ๐ป ๐พ ๐ผ ๐พ๐ป ๐ผ ๐ฝ ๐ผ = ๐ฝ๐ป ๐ป ๐ผ ๐ฝ ๐ผ ๐ฝ ๐ป ๐พ ๐ผ Hence ๐ฉ๐ฉ ๐ผ = ๐ฝ ๐ป ๐ ๐ฝ ๐ผ Recall that columns of ๐ฝ are all linear independent (orthogonal matrices), then from diagonalization ( ๐ช = ๐๐ฌ๐ 1๐ ), we get: โข The columns of ๐ฝ are the eigenvectors of the matrix ๐ฉ๐ฉ ๐ผ
How can we compute an SVD of a matrix A ? 1. Evaluate the ๐ eigenvectors ๐ฐ 3 and eigenvalues ๐ 3 of ๐ฉ ๐ผ ๐ฉ 2. Make a matrix ๐พ from the normalized vectors ๐ฐ 3 . The columns are called โright singular vectorsโ. โฎ โฆ โฎ ๐พ = ๐ฐ & โฆ ๐ฐ ' โฎ โฆ โฎ 3. Make a diagonal matrix from the square roots of the eigenvalues. ๐ & ๐ป = ๐ 3 = ๐ 3 and ๐ & โฅ ๐ ) โฅ ๐ * โฆ โฑ ๐ ' 4. Find ๐ฝ: ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ โน ๐ฝ ๐ป = ๐ฉ ๐พ โน ๐ฝ = ๐ฉ ๐พ ๐ป 1๐ . The columns are called the โleft singular vectorsโ.
True or False? ๐ฉ has the singular value decomposition ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ . โข The matrices ๐ฝ and ๐พ are not singular โข The matrix ๐ป can have zero diagonal entries ๐ฝ ) = 1 โข โข The SVD exists when the matrix ๐ฉ is singular โข The algorithm to evaluate SVD will fail when taking the square root of a negative eigenvalue
Singular values are always non-negative Singular values cannot be negative since ๐ฉ ๐ผ ๐ฉ is a positive semi- definite matrix (for real matrices ๐ฉ ) โข A matrix is positive definite if ๐ ๐ผ ๐ช๐ > ๐ for โ๐ โ ๐ โข A matrix is positive semi-definite if ๐ ๐ผ ๐ช๐ โฅ ๐ for โ๐ โ ๐ โข What do we know about the matrix ๐ฉ ๐ผ ๐ฉ ? ๐ ๐ผ ๐ฉ ๐ผ ๐ฉ ๐ = (๐ฉ๐) ๐ผ ๐ฉ๐ = ๐ โฅ 0 ๐ฉ๐ ๐ โข Hence we know that ๐ฉ ๐ผ ๐ฉ is a positive semi-definite matrix โข A positive semi-definite matrix has non-negative eigenvalues ๐ช๐ = ๐๐ โน ๐ ๐ผ ๐ช๐ = ๐ ๐ผ ๐ ๐ = ๐ ๐ ๐ ๐ โฅ 0 โน ๐ โฅ 0
Cost of SVD The cost of an SVD is proportional to ๐ ๐ ๐ + ๐ ๐ where the constant of proportionality constant ranging from 4 to 10 (or more) depending on the algorithm. ๐ท 456 = ๐ฝ ๐ ๐ ) + ๐ * = ๐ ๐ * ๐ท .78.78 = ๐ * = ๐ ๐ * ๐ท 9: = 2๐ * /3 = ๐ ๐ *
SVD summary: โข The SVD is a factorization of a ๐ร๐ matrix into ๐ฉ = ๐ฝ ๐ป ๐พ ๐ผ where ๐ฝ is a ๐ร๐ orthogonal matrix, ๐พ ๐ผ is a ๐ร๐ orthogonal matrix and ๐ป is a ๐ร๐ diagonal matrix. ๐ผ , where ๐ฝ ๐บ is a ๐ร๐ matrix, ๐ป ๐บ is a ๐ ร๐ matrix, โข In reduced form: ๐ฉ = ๐ฝ ๐บ ๐ป ๐บ ๐พ ๐บ and ๐พ ๐บ is a ๐ร๐ matrix, and ๐ = min(๐, ๐) . โข The columns of ๐พ are the eigenvectors of the matrix ๐ฉ ๐ผ ๐ฉ , denoted the right singular vectors. The columns of ๐ฝ are the eigenvectors of the matrix ๐ฉ๐ฉ ๐ผ , denoted the left singular โข vectors. โข The diagonal entries of ๐ป ๐ are the eigenvalues of ๐ฉ ๐ผ ๐ฉ. ๐ & = ๐ & are called the singular values. โข The singular values are always non-negative (since ๐ฉ ๐ผ ๐ฉ is a positive semi-definite matrix, the eigenvalues are always ๐ โฅ 0 )
Singular Value Decomposition (applications)
1) Determining the rank of a matrix Suppose ๐ฉ is a ๐ร๐ rectangular matrix where ๐ > ๐ : ๐ " โฑ ( โฎ โฆ โฎ โฆ โฎ โฆ ๐ฐ " โฆ ๐ ' ๐ฉ = ๐ " โฆ ๐ ' โฆ ๐ # โฎ โฎ โฎ 0 ( โฎ โฆ โฎ โฆ โฎ โฆ ๐ฐ ' โฆ โฎ 0 ( โฎ โฆ โฎ โฆ ๐ " ๐ฐ " โฆ ( + ๐ ) ๐ ) ๐ฐ ) ( + โฏ + ๐ ' ๐ ' ๐ฐ ' ( ๐ฉ = = ๐ " ๐ " ๐ฐ " ๐ " โฆ ๐ ' โฎ โฎ โฎ ( โฎ โฆ โฎ โฆ ๐ ' ๐ฐ ' โฆ $ % ๐ฉ = = ๐ ! ๐ ! ๐ฐ ! !"# % what is rank ๐ฉ # = ? ๐ฉ # = ๐ # ๐ # ๐ฐ # A) 1 B) n C) depends on the matrix In general, rank ๐ฉ & = ๐ D) NOTA
Rank of a matrix For general rectangular matrix ๐ฉ with dimensions ๐ร๐ , the reduced SVD is: ๐ผ ๐ฉ = ๐ฝ ๐บ ๐ป ๐บ ๐พ ๐บ ๐ = min(๐, ๐) H ๐ ร๐ ๐ร๐ ๐ร๐ ( ๐ฉ = I ๐ 3 ๐ 3 ๐ฐ 3 ๐ร๐ 3G& ๐ # ๐ # โฑ 0 ๐ & ๐ฏ = โฑ โฑ ๐ฏ = ๐ & 0 โฆ 0 0 0 โฑ โฎ 0 If ๐ & โ 0 โ๐ , then rank ๐ฉ = ๐ (Full rank matrix) In general, rank ๐ฉ = ๐ , where ๐ is the number of non-zero singular values ๐ & ๐ < ๐ (Rank deficient)
Rank of a matrix โข The rank of A equals the number of non-zero singular values which is the same as the number of non-zero diagonal elements in ฮฃ . โข Rounding errors may lead to small but non-zero singular values in a rank deficient matrix, hence the rank of a matrix determined by the number of non-zero singular values is sometimes called โeffective rankโ. โข The right-singular vectors (columns of ๐พ ) corresponding to vanishing singular values span the null space of A . โข The left-singular vectors (columns of ๐ฝ ) corresponding to the non-zero singular values of A span the range of A .
2) Pseudo-inverse โข Problem: if A is rank-deficient, ๐ป is not be invertible โข How to fix it: Define the Pseudo Inverse โข Pseudo-Inverse of a diagonal matrix : & O & , if ๐ 3 โ 0 ๐ป N 3 = N 0, if ๐ 3 = 0 โข Pseudo-Inverse of a matrix ๐ฉ : ๐ฉ N = ๐พ๐ป N ๐ฝ ๐ผ
3) Matrix norms The Euclidean norm of an orthogonal matrix is equal to 1 ๐ฝ๐ ๐ผ (๐ฝ๐) = max ๐ ๐ผ ๐ = max ๐ฝ ) = max ๐ ! +" ๐ฝ๐ ) = max ๐ ! +" ๐ ) = 1 ๐ ! +" ๐ ! +" The Euclidean norm of a matrix is given by the largest singular value ๐ ! +" ๐ฝ ๐ป ๐พ ๐ผ ๐ ) = max ๐ ! +" ๐ป ๐พ ๐ผ ๐ ) = ๐ฉ ) = max ๐ ! +" ๐ฉ๐ ) = max ๐พ ๐ผ ๐ ! +" ๐ป ๐พ ๐ผ ๐ ) = max = max ๐ ! +" ๐ป ๐ ) = max(๐ & ) Where we used the fact that ๐ฝ ) = 1 , ๐พ ) = 1 and ๐ป is diagonal ๐ฉ ) = max ๐ & = ๐ #./ ๐ '() is the largest singular value
4) Norm for the inverse of a matrix The Euclidean norm of the inverse of a square-matrix is given by: Assume here ๐ฉ is full rank, so that ๐ฉ 1& exists ๐ฉ 0" ) = max ๐ ! +" (๐ฝ ๐ป ๐พ ๐ผ ) 0" ๐ ) = max ๐ ! +" ๐พ ๐ป 0๐ ๐ฝ ๐ผ ๐ ) Since ๐ฝ ) = 1 , ๐พ ) = 1 and ๐ป is diagonal then " ๐ฉ 0" ) = ๐ '!$ is the smallest singular value 2 #$%
Recommend
More recommend