Home > Objects > @iData > pca.m



[b] = pca(X, k) : Principal component analysis of iData object(s)


function b = pca(a, varargin)


 [b] = pca(X, k) : Principal component analysis of iData object(s)

   @iData/pca function to perform a Principal component analysis of object(s)

   b = pca(a,k) computes the principal component analysis of an object in a k-D
     space representation. This corresponds to a classification of the objects
     rows, searching for similarities/correlations. The resulting principal 
     component coefficients object contains the same number of rows as 'a', and
     k columns for coordinates.
     Rows (rank 1) of X correspond to observations and further ranks correspond 
     to variables.
   b = pca(a) assumes k=2 (2D space classifier).
   b = pca([a1 a2 ...], k) performs the PCA along all objects specified in the 
     array, and return the principal component coefficients. The resulting object
     contains as many rows as the number of objects specified, and k columns.
   b = pca(a, key, value, ...)
     specifies the PCA configuration as key=value pairs:
         Number of components requested, specified as the comma-separated pair
         consisting of 'NumComponents' and a scalar integer k satisfying 
         0 < k <= p, where p is the number of original variables in X. When 
         specified, pca returns the first k PCA coefficients.
       'Centered', True(default) or False
         Center the variables by subtracting the mean values
       'VariableWeights', false or 'variance'
         'variance' to normalize variables to their variance (default)

 input:  X: object or array (iData)
         k: number of components wanted (integer, default is 2)
 output: b: principal component object (iData)
 ex:     b=pca(a); plot(b); text(b{1},b{2}, get(a,'Title'));

 See: http://en.wikipedia.org/wiki/Principal_component_analysis

 Version: Mar. 22, 2017
 See also iData, iData/kmeans, iData/cwt, iData/corrcoef


This function calls: This function is called by:
Generated on Wed 22-Mar-2017 09:13:30 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1