SVD와 Eigendecomposition (feat. PCA)

Min·2021년 10월 18일

인공지능 수학

목록 보기
2/4

Theorem: A real matrix A is symmetric if and only if A can be diagonalized by an orthogonal matrix
(diagonalizable 이라는 건 Eigendecomposition이 가능하다)

행렬 A가 Real & Symmetric 이라면
1. eigenvalues are real
2. eigenvectors can be real & orthonormal

행렬 A가 positive semi definite 이라면
-> All eigenvalues of A are nonnegative

Sample covariance matrix 에 사용되는
Q = (1 / (n - 1)) Z^{transpose} Z는 symmetric
-> Q is diagonalizable!
-> eigenvectors are orthonormal!

SVD 를 사용하면
real 행렬 M에 대해서 M = U S V^{transpose}
(여기서 U와 V는 orthogonal)
-> 그럼 M^{transpose} M = V D V^{-1}
-> 주의해서 볼 점은 M^{transpose} M은 real & symmetric
-> 그러므로!! M^{transpose} M은 diagonalizable 하고
모든 eigenvectors은 orthonormal로 만들 수 있다!
-> 그럼 V에 해당하는 부분이 M^{transpose} M의 eigenvectors의 모임, D에 해당하는 것이 M^{transpose} M eigenvalues로 만든 diagonal matrix가 되는 것이다.
( 반대로 M M^{transpose}는 U에 해당된다.)
-> 즉, SVD를 통하여 M^{transpose} M의 eigenvector와 eigenvalue를 구하는 것이 가능하다

방금 SVD에서 살펴본 M^{transpose} M 와
Sample Covariance에서 본 Q = (1 / (n - 1)) Z^{transpose} Z
그 형태가 똑같다.
-> Sample Covariance를 eigenDecomposition를 통해 X의 SVD를 할 수 있다! 이는 PCA에 쓰인다.

여기서 PCA의 절차를 살펴보자

Input : n * d matrix X, number of PC's to use k

Process

  • Compute sample covariance matrix of X, let it be Q
  • Calculate eigenvectors and corresponding eigenvalues of Q
  • Choose k eigenvectors with largest corresponding eigenvalues of Q
  • Return thos k eigenvectors

Output : k principal components of X

0개의 댓글