princomp function (coeff, score, latent)
15 ビュー (過去 30 日間)
古いコメントを表示
I am trying to do principal component analysis (PCA) using matlab. However, some of the names are confusing.
1) I have 100-by-2595 matrix raw data of signals (EMG that measures muscle activity). When I used Matlab's princomp, it gave me different coefficients or loading factors from that of different statistical program, such as Statistica. How does Matlab calculate for coefficients?
2) 'score' is one of the commands used as part of princomp. I am guessing that this is the actual curve or sginal of one principal component. Is this true?
I am using a very simple code if true [coeff,score,latent] = princomp(zscore(a)); % a= raw data end
0 件のコメント
回答 (1 件)
Shashank Prasanna
2013 年 8 月 23 日
編集済み: Shashank Prasanna
2013 年 8 月 23 日
PRINCOMP assumes rows are the observations. Which means if a is 100x2595 you'd have to use the transpose:
>> [COEFF,SCORE,latent,tsquare] = princomp(zscore(a'))
MATLAB computes pca using svd, same as most software I assume. If you want to compute pca using a precomputed covariance matrix then use PCACOV
If your results are different, make sure if the the other software is centering and scaling as well.
SCORE is the projection of your original data onto the principle component space. For example SCORE(:,1) would be the projection of your data onto the first pc and so on.
1 件のコメント
Asim Shahzad
2020 年 5 月 1 日
Your answer saved me. Thank you.
I wonder why this isn't the first thing they mentioned in the docs though.
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!