Principle Component Analysi12
Principle Component Analysi12
Principle Component Analysi12
Classifier
Dimension reduction
PCA will find the principle components from dataset and sort them wrt to level of significance
X + Y+ Z + T = C
δ1*X + δ2*Y + δ3*Z + δ4*T = C
0.1X +0.3Y +0.2Z+0.4T
N
∑ δi=1
i=1
Steps of PCA
M-
H M H-Mean(H) Mean(M) Var (H)
-
23.416666
9 39 -4.9166667 7 115.1319444 24.17361111
-
1.0833333 6.4166666 -
15 56 3 7 6.951388889 1.173611111
11.083333 30.583333
25 93 3 3 338.9652778 122.8402778
-
0.0833333 1.4166666 -
14 61 3 7 0.118055556 0.006944444
10 50 -3.9166667 - 48.63194444 15.34027778
12.416666
7
4.0833333 12.583333
18 75 3 3 51.38194444 16.67361111
-
30.416666
0 32 -13.916667 7 423.2986111 193.6736111
2.0833333 22.583333
16 85 3 3 47.04861111 4.340277778
-
20.416666
5 42 -8.9166667 7 182.0486111 79.50694444
5.0833333 7.5833333
19 70 3 3 38.54861111 25.84027778
2.0833333 3.5833333
16 66 3 3 7.465277778 4.340277778
6.0833333 17.583333
20 80 3 3 106.9652778 37.00694444
1352.416667 524.9166667
Mean 13.9166
(H) 7
Mean( 62.4166
M) 7
COVS 122.947
112.701
CovP 4
Var(H) 47.7197
Var(H) 47.7197
370.083
Var(M) 3
Cov Matrix
COV(H,H COV(H,M
COV (H,M) ) )
COV(M,H COV(M,M
) )
COV(X,Z
COV(X,Y,Z) COV(X,X) COV(X,Y) )
COV(Y,Z
COV(Y,X) COV(Y,Y) )
COV(Z,Z
COV(Z.X) COV(Z,Y) )
AX=λX
A= Input Vector (Covariance matrix)
X=Eigen Vector
λ= Eigen value
AX-λX=0
(A-λ)X=0
(A-λI)X=0
let B=(A-λI)
BX=0
X= B−1 .0
Determinant(B)=0
Example
Let A is the covariance matrix of X,Y,Z
(A-λI)X=0
A I
1 2 1 1 0 0
6 -1 0 - λ 0 1 0
-1 -2 -1 0 0 1
1 2 1 λ 0 0
6 -1 0 - 0 λ 0
-1 -2 -1 0 0 λ
1-λ 2 1
6 -1-λ 0
-1 -2 -1-λ
1 6 -1-λ - 0 1-λ 2 + -1-λ 1-λ 2
-1 -2 -1 -2 6 -1-λ
clc;
clear all;
close all;
A=[1 2 1; 6 -1 0; -1 -2 -1];
[U V]=eig(A);
clc;
clear all;
close all;
H=[9 15 25 14 10 18 0 16 5 19 16 20];
M=[39 56 93 61 50 75 32 85 42 70 66 80];
C=cov(H,M)