Pcaengine: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Scott |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Principal components analysis computational engine. | Principal components analysis computational engine. | ||
===Synopsis=== | ===Synopsis=== | ||
:[ssq,datarank,loads,scores,msg] = pcaengine(data,''ncomp,options'') | :[ssq,datarank,loads,scores,msg] = pcaengine(data,''ncomp,options'') | ||
===Description=== | ===Description=== | ||
This function is intended primarily for use as the engine behind other more full featured PCA programs. The only required input is | |||
Optional inputs include the number of principal components desired in the output ''ncomp'', and a structure containing optional inputs ''options''. If the number of components ''ncomp'' is not specified, the routine will return components up to the rank of the data datarank. | This function is intended primarily for use as the engine behind other more full featured PCA programs. The only required input is a data matrix. | ||
The outputs are the variance or sum-of-squares captured table ssq, mathematical rank of the data datarank, principal component loadings loads, principal component scores scores, and a text variable containing any warning messages msg. | |||
Optional inputs include the number of principal components desired in the output ''<tt>ncomp</tt>'', and a structure containing optional inputs ''<tt>options</tt>''. If the number of components ''<tt>ncomp</tt>'' is not specified, the routine will return components up to the rank of the data <tt>datarank</tt>. | |||
The outputs are the variance or sum-of-squares captured table <tt>ssq</tt>, mathematical rank of the data <tt>datarank</tt>, principal component loadings <tt>loads</tt>, principal component scores <tt>scores</tt>, and a text variable containing any warning messages <tt>msg</tt>. | |||
To enhance speed, the routine is written so that only the specified outputs are computed. | To enhance speed, the routine is written so that only the specified outputs are computed. | ||
====Inputs==== | |||
* '''data''' = input data matrix | |||
====Optional Inputs==== | |||
* '''ncomp''' = number of principal components desired in the output | |||
* '''''options''''' = discussed below. | |||
====Outputs==== | |||
* '''ssq''' = The outputs are the variance or sum-of-squares captured table | |||
* '''datarank''' = mathematical rank of the data | |||
* '''loads''' = principal component loadings | |||
* '''scores''' = principal component scores | |||
* '''msg''' = a text variable containing any warning messages | |||
===Options=== | ===Options=== | ||
''options'' = a structure array with the following fields: | |||
* '''display''': [ 'off' | {'on'} ], governs level of display to command window, | * '''display''': [ 'off' | {'on'} ], governs level of display to command window, | ||
* '''algorithm''': [ {'regular'} | 'big' | 'auto'], tells which algorithm to use, | * '''algorithm''': [ {'regular'} | 'big' | 'auto'], tells which algorithm to use, | ||
* ''''regular',''' uses an SVD and calculates all eigenvectors and eigenvalues, | |||
* ''''big',''' calculates the "economy size" SVD, and | :* ''''regular',''' uses an SVD and calculates all eigenvectors and eigenvalues, | ||
* ''''auto',''' checks the size of the data matrix and automatically chooses between 'regular' and 'big' | |||
:* ''''big',''' calculates the "economy size" SVD, and | |||
:* ''''auto',''' checks the size of the data matrix and automatically chooses between 'regular' and 'big' | |||
The default options can be retreived using: options = pcaengine('options');. | The default options can be retreived using: options = pcaengine('options');. | ||
===See Also=== | ===See Also=== | ||
[[analysis]], [[evolvfa]], [[ewfa]], [[explode]], [[parafac]], [[pca]], [[ssqtable]] | |||
[[analysis]], [[estimatefactors]], [[evolvfa]], [[ewfa]], [[explode]], [[parafac]], [[pca]], [[ssqtable]], [[subgroupcl]] |
Latest revision as of 09:32, 21 September 2011
Purpose
Principal components analysis computational engine.
Synopsis
- [ssq,datarank,loads,scores,msg] = pcaengine(data,ncomp,options)
Description
This function is intended primarily for use as the engine behind other more full featured PCA programs. The only required input is a data matrix.
Optional inputs include the number of principal components desired in the output ncomp, and a structure containing optional inputs options. If the number of components ncomp is not specified, the routine will return components up to the rank of the data datarank.
The outputs are the variance or sum-of-squares captured table ssq, mathematical rank of the data datarank, principal component loadings loads, principal component scores scores, and a text variable containing any warning messages msg.
To enhance speed, the routine is written so that only the specified outputs are computed.
Inputs
- data = input data matrix
Optional Inputs
- ncomp = number of principal components desired in the output
- options = discussed below.
Outputs
- ssq = The outputs are the variance or sum-of-squares captured table
- datarank = mathematical rank of the data
- loads = principal component loadings
- scores = principal component scores
- msg = a text variable containing any warning messages
Options
options = a structure array with the following fields:
- display: [ 'off' | {'on'} ], governs level of display to command window,
- algorithm: [ {'regular'} | 'big' | 'auto'], tells which algorithm to use,
- 'regular', uses an SVD and calculates all eigenvectors and eigenvalues,
- 'big', calculates the "economy size" SVD, and
- 'auto', checks the size of the data matrix and automatically chooses between 'regular' and 'big'
The default options can be retreived using: options = pcaengine('options');.
See Also
analysis, estimatefactors, evolvfa, ewfa, explode, parafac, pca, ssqtable, subgroupcl