IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
princomp2.m File Reference

Detailed Description

Principal Component Analysis (PCA)

PCA formula:

scores = X*loadings

Loadings are the eigenvectors of the X's scatter matrix. The scatter matrix is defined ad X'*X, a simmetric positive definite or semi-definite with rank r <= nf.

Meanings of the possible outputs:

  • scores: [no][r] PCA scores (r is the rank of the dataset's scatter matrix).
  • loadings: [nf][r] loadings matrix.
  • lambdas: [r]x[1] contains the eigenvalues of the scatter matrix.

Note: the loadings vectors sometimes happen to point at the opposite directions of those obtaines by MATLAB's princomp() (not really a problem).

References

[1] R. O. Duda, P. E. Hart, and D. G. Stork, Pattern Classification, 2nd ed. New York: John Wiley & Sons, 2001.

Definition in file princomp2.m.

Go to the source code of this file.

Functions

function princomp2 (in X)
 

Function Documentation

function princomp2 ( in  X)
Parameters
X[no]x[nf] matrix
Returns
[loadings] or [loadings, scores] or [loadings, scores, lambdas]