Principle Component Analysis 主成分分析
Intro
PCA is one of the most important and widely used dimension reduction algorithm. Other dimension reduction algorithm include LDA, LLE and Laplacian Eigenmaps.
You can regard PCA as a one layer neural network with nD input and mD output.
PCA reject nD data to mD with the maximum various.

PCA
We want to reduct data from nD to mD.
Y=AX
Y−Rm∗1A−Rm∗nX−Rn∗1
A=⎣⎢⎢⎡−a1−−a2−...−am−⎦⎥⎥⎤Y=⎣⎢⎢⎡a1(x−xˉ)a2(x−xˉ)...am(x−xˉ)⎦⎥⎥⎤
⎩⎨⎧Y=A(X−Xˉ)xˉ=E(X)=p1p=1∑Pxp
maxi=1∑P(yi−yˉi)2
yˉi=p1i=1∑Pyi=pai(i=1∑Pxi−pxˉ)=0
i=1∑P(yi−yˉi)2=i=1∑P[a1(xi−xˉ)]2 =i=1∑Pa1[(xi−xˉ)(xi−xˉ)T]a1T =a1i=1∑P[(xi−xˉ)(xi−xˉ)T]a1T =a1Σa1T
Σ – covariance matrix
Our target:
{max a1Σa1Ts.t. a1a1T=∣∣a1∣∣2=1
apply Lagrange multiplier method:
E(a1)=a1Σa1T−λ1(a1a1T−1)∂a1∂E=(Σa1T−λ1a1T)T=0Σa1T=λ1a1T
λ1 is the largest eigenvalue of Σ, and a1 is its eigenvector.
{max a2Σa2Ts.t. a2a2T=∣∣a2∣∣2=1
…(same method)
λ2 is the second largest eigenvalue of Σ, and a2 is its eigenvector.
…
Summary
① find the value of Σ
② find the eigenvalues ai of Σ and sort them
③ normalize ai, let a1a1T=1
④ A=⎣⎢⎢⎡−a1−−a2−...−am−⎦⎥⎥⎤Y=⎣⎢⎢⎡a1(x−xˉ)a2(x−xˉ)...am(x−xˉ)⎦⎥⎥⎤
⑤ Y=A(X−Xˉ)