質問

For certain measurements i need to obtain only the numeric value of the first principal component from the matrix. Can someone please tell me how do i go about it?

役に立ちましたか?

解決

the most straight forward way is just to get the top eigenvector/value of your data's covariance matrix using eigs

say the data matrix x is N by D, or # of data by dimension of data

you can simply do

C = cov(X);
[V, D] = eigs(C, 1);

in fact, you can get the top k principal components by running

[V, D] = eigs(C, k);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top