princomp function (coeff, score, latent)

15 visualizzazioni (ultimi 30 giorni)
Dylan
Dylan il 22 Ago 2013
Commentato: Asim Shahzad il 1 Mag 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

Risposte (1)

Shashank Prasanna
Shashank Prasanna il 23 Ago 2013
Modificato: Shashank Prasanna il 23 Ago 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 Commento
Asim Shahzad
Asim Shahzad il 1 Mag 2020
Your answer saved me. Thank you.
I wonder why this isn't the first thing they mentioned in the docs though.

Accedi per commentare.

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by