princomp function (coeff, score, latent)

조회 수: 26 (최근 30일)
Dylan
Dylan 2013년 8월 22일
댓글: Asim Shahzad 2020년 5월 1일
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

답변 (1개)

Shashank Prasanna
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
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 CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by