PLS_Toolbox Documentation: pca | < parsemixed | pcaengine > |
pca
Purpose
Perform principal components analysis.
Synopsis
pca
model = pca(data,ncomp,options); %decomposition
pred = pca(newdata,model,options); %application
options = pca('options')
Description
Performs a principal component analysis decomposition of the input array data returning ncomp principal components. E.g. for an M by N matrix X the PCA model is X = TPT + E, where the scores matrix T is M by K, the loadings matrix P is N by K, the residuals matrix E is M by N, and K is the number of factors or principal components ncomp. The output model is a PCA model structure. This model can be applied to new data by passing the model structure to PCA along with new data newdata or by using PCAPRO. The output of PCA is a model structure with the following fields (see MODELSTRUCT for additional information):
If the inputs are a Mnew by N matrix newdata and and a PCA model model, then PCA applies the model to the new data. Preprocessing included in model will be applied to newdata. The output pred is structure, similar to model, that contains the new scores, and other predictions for newdata.
Note: Calling pca with no inputs starts the graphical user interface (GUI) for this analysis method.
Options
The default options can be retreived using: options = pca('options');.
OUTPUTVERSION
By default (options.outputversion = 3) the output of the function is a standard model structure model. If options.outputversion = 2, the output format is:
[scores,loads,ssq,res,reslm,tsqlm,tsq] = pca(xblock1,2,options);
where the outputs are
PREPROCESSING
The preprocessing field can be empty [] (indicating that no preprocessing of the data should be used), or it can contain a preprocessing structure output from the PREPROCESS function. For example options.preprocessing = {preprocess('default', 'autoscale')}. This information is echoed in the output model in the model.detail.preprocessing field and is used when applying the PCA model to new data.
See Also
analysis, evolvfa, ewfa, explode, parafac, plotloads, plotscores, preprocess, ssqtable
< parsemixed | pcaengine > |