princomp function (coeff, score, latent)

28 Ansichten (letzte 30 Tage)
Dylan
Dylan am 22 Aug. 2013
Kommentiert: Asim Shahzad am 1 Mai 2020
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

Antworten (1)

Shashank Prasanna
Shashank Prasanna am 23 Aug. 2013
Bearbeitet: Shashank Prasanna am 23 Aug. 2013
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 Kommentar
Asim Shahzad
Asim Shahzad am 1 Mai 2020
Your answer saved me. Thank you.
I wonder why this isn't the first thing they mentioned in the docs though.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by