Home > lib > princomp2.m

princomp2

PURPOSE ^

Principal Component Analysis (PCA)

SYNOPSIS ^

function [scores, varargout] = princomp2(X)

DESCRIPTION ^

 Principal Component Analysis (PCA)

 [scores] = princomp2(X, flag_rotate = 0)
 [scores, loadings] = princomp2(X, flag_rotate = 0)
 [scores, loadings, lambdas] = princomp2(X, flag_rotate = 0)

 Explanation:
   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 <= d

 Inputs:
   X: [n][d] dataset matrix, columns stand for features and rows stand for
      observations

 Outputs: 
   scores: [n][r] PCA scores.
   loadings: [d][r] loadings matrix (r is the rank of the dataset's
             scatter matrix (see below for scatter matrix definition).
             Loadings are actually the eigenvectors of the scatter matrix.
   lambdas: [r][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).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Thu 18-Feb-2010 12:47:47 by m2html © 2003