Pcapro: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Purpose===
===Purpose===


Line 7: Line 6:


:[scoresn,resn,tsqn] = pcapro(newdata,loads,ssq,reslm,tsqlm,''plots'')
:[scoresn,resn,tsqn] = pcapro(newdata,loads,ssq,reslm,tsqlm,''plots'')
:[scoresn,resn,tsqn] = pcapro(newdata,pcamod,''plots'')
:[scoresn,resn,tsqn] = pcapro(newdata,pcamod,''plots'')


===Description===
===Description===


Inputs can be in two forms: 1) as a list of input variables, or 2) as a single model structure variable returned by ANALYSIS or PCA.
This function applies a previously-determined PCA model to a set of new data <tt>newdata</tt>. The PCA model can be input in one of two possible forms: 1) as a list of input variables, or 2) as a single model structure variable that had been previously returned by [[analysis]] or [[pca]].
 
1) If a list of input variables is used the inputs are the new data newdata scaled the same as the original data used to construct the model, the model loadings loads, the model variance info ssq, the limit for Q reslm, the limit for T<sup>2</sup> tsqlm, and an optional variable ''plots'' which suppresses plotting when set to 0 {default ''plots'' ? 1}.
 
WARNING: Scaling for newdata should be the same as original data used to create the PCA model!


The I/O format is:
For case 1), the scaling for <tt>newdata</tt> should be the same as for the original data used to build the model. For case 2), '''pcapro''' will scale <tt>newdata</tt> based on data contained in <tt>pcamod</tt>


:[scoresn,resn,tsqn] = pcapro(newdata,loads,ssq,q,tsq,''plots'')
====Inputs====


2) If the PCA model is input as the single model structure variable returned by ANALYSIS or PCA then the inputs are the new data newdata in the units of the original data, the structure variable that contains the PCA model pcamod, and an optional variable ''plots'' which suppresses the plots when set to 0 {default ''plots'' ???}.
: Case 1) model input as a list of variables:
:* '''newdata''' = data to be applied to the existing PCA model, ''scaled the same as the original data used to build the model''
:* '''loads''' = the model loadings
:* '''ssq''' =  the model variance information
:* '''reslm''' = the limit for Q residuals
:* '''tsqlm''' = the limit for T<sup>2</sup>
:* '''plots''' = optional variable, which suppresses plotting when set to 0 {default '''plots''' = 1}.


NOTE: newdata will be preprocessed in PCAPRO using information stored in pcamod (pcamod.detail.preprocessing).
: Case 2) model input as a single model structure:
:* '''newdata''' = data to be applied to the existing PCA model, ''in the units of the original data''
:* '''pcamod''' = the structure variable that contains the PCA model
:* '''plots''' = optional variable, which suppresses the plots when set to 0 {default '''plots''' = 1}.


The I/O format is:
====Outputs====
 
:[scoresn,resn,tsqn] = pcapro(newdata,pcamod,''plots'')


Outputs are the new scores scoresn, residuals resn, and T<sup>2</sup> values tsqn. These are plotted if plots ??? {default}.
* '''scoressn''' = the new scores
* '''resn''' = new residuals
* '''tsqn''' = new T<sup>2</sup> values


===See Also===
===See Also===


[[datahat]], [[analysis]], [[explode]], [[modlpred]], [[pca]], [[simca]], [[tsqmtx]]
[[datahat]], [[analysis]], [[explode]], [[modlpred]], [[pca]], [[simca]], [[tsqmtx]]

Latest revision as of 14:35, 10 October 2008

Purpose

Project new data onto an existing principal components model.

Synopsis

[scoresn,resn,tsqn] = pcapro(newdata,loads,ssq,reslm,tsqlm,plots)
[scoresn,resn,tsqn] = pcapro(newdata,pcamod,plots)

Description

This function applies a previously-determined PCA model to a set of new data newdata. The PCA model can be input in one of two possible forms: 1) as a list of input variables, or 2) as a single model structure variable that had been previously returned by analysis or pca.

For case 1), the scaling for newdata should be the same as for the original data used to build the model. For case 2), pcapro will scale newdata based on data contained in pcamod

Inputs

Case 1) model input as a list of variables:
  • newdata = data to be applied to the existing PCA model, scaled the same as the original data used to build the model
  • loads = the model loadings
  • ssq = the model variance information
  • reslm = the limit for Q residuals
  • tsqlm = the limit for T2
  • plots = optional variable, which suppresses plotting when set to 0 {default plots = 1}.
Case 2) model input as a single model structure:
  • newdata = data to be applied to the existing PCA model, in the units of the original data
  • pcamod = the structure variable that contains the PCA model
  • plots = optional variable, which suppresses the plots when set to 0 {default plots = 1}.

Outputs

  • scoressn = the new scores
  • resn = new residuals
  • tsqn = new T2 values

See Also

datahat, analysis, explode, modlpred, pca, simca, tsqmtx