Reputation: 11
We need to find eigen vectors using PCA. We are using princomp ( matrix ). Which gives principal component co-efficient, transformed data and eigen values.
For below data :
2.5 2.4
0.5 0.7
2.2 2.9
1.9 2.2
3.1 3
2.3 2.7
2 1.6
1 1.1
1.5 1.6
1.1 0.9
function PCAFinder(filein)
X = csvread(filein);
[pc,score,latent] = princomp(X);
pc
transpose(pc)
end
Principal component co-efficient returned by above code (pc)
0.6779 0.7352
0.7352 -0.6779
Actual Eigen vector to be produced :
-0.7352 -0.6779
0.6779 -0.7352
How to get the above eigen vectors
Upvotes: 1
Views: 573
Reputation: 18580
The principal component co-efficient returned is a valid eigenvector matrix of the covariance matrix of your data. Eigenvectors are unique only up to an orthogonal transformation. For a more detailed discussion see my answer to an older SO question here.
In this particular case, the appropriate orthogonal transformation to obtain exact equality between your matrices is to multiply your PC coefficient matrix by: [0 1; -1 0]
Upvotes: 1