Varcap: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Scott
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Variance captured for each variable in PCA model.
 
Variance captured for each variable in any 2-way factor-based model.
 
===Synopsis===
===Synopsis===
:vc = varcap(x,loads,''scl,plots'')
 
:vc = varcap(X,T,P,scl,plots);
:vc = varcap(X,model,scl,plots);
 
===Description===
===Description===
VARCAP calculates and displays the percent variance captured for each variable and number of principal components in a PCA model.
Calculates percent variance captured in a model for each variable and number of components. Inputs are the properly scaled data (x) [MxN], and the associated scores (T) and loading matrices (P). Valid models include: PCA, PCR, PLS, CLS, LWR For non-orthogonal models, varcap splits variation into unique variance for each component and one common part.
Inputs are the properly scaled ''M'' by ''N'' data x (''i.e.'' scaled using the same scaling used when creating the PCA model) with associated ''N'' by ''K'' loadings matrix loads.
 
Optional input ''scl'' (1 by ''N'') specifies the x-axis for plotting. Optional input ''plots'' suppresses plotting when set to 0 {default = 1}.
Optional inputs are (scl) [1xN] which specifies the x-axis for plotting, and (plots) which suppresses plotting when set to 0.
The output is a ''K'' by ''N'' matrix of variance captured vc for each variable and each number of PCs considered (vc is number of PCs by number of variables). A stacked bar chart of vc is also plotted. Optional input ''plots'' suppresses plotting when set to 0 {default = 1}.
 
SPECIAL NOTES:
* Scores (T) can be omitted if and only if the loadings are ortho-normal (such as those from a PCA or PCR model) in which case, it will be assumed that scores can be calculated from:
: T = XP
: If this is not valid for the given loadings, the variance captured will be incorrect.
 
* If a model is passed in place of T, the scores, loadings, and scale will be extracted from the model. Howver, a user-defined scale and the plots flag can be input along with the model.
 
====Outputs====
The output is a matrix of % variance captured (vc) [K+2xN] for each variable on each component. Row one up to the number of components shows the UNIQUE variance of components (variance in common has been removed). Row component+1, shows the common variation. The last row is the total variation.
 
===See Also===
===See Also===
[[analysis]], [[pca]]
[[analysis]], [[pca]]

Latest revision as of 11:25, 14 March 2012

Purpose

Variance captured for each variable in any 2-way factor-based model.

Synopsis

vc = varcap(X,T,P,scl,plots);
vc = varcap(X,model,scl,plots);

Description

Calculates percent variance captured in a model for each variable and number of components. Inputs are the properly scaled data (x) [MxN], and the associated scores (T) and loading matrices (P). Valid models include: PCA, PCR, PLS, CLS, LWR For non-orthogonal models, varcap splits variation into unique variance for each component and one common part.

Optional inputs are (scl) [1xN] which specifies the x-axis for plotting, and (plots) which suppresses plotting when set to 0.

SPECIAL NOTES:

  • Scores (T) can be omitted if and only if the loadings are ortho-normal (such as those from a PCA or PCR model) in which case, it will be assumed that scores can be calculated from:
T = XP
If this is not valid for the given loadings, the variance captured will be incorrect.
  • If a model is passed in place of T, the scores, loadings, and scale will be extracted from the model. Howver, a user-defined scale and the plots flag can be input along with the model.

Outputs

The output is a matrix of % variance captured (vc) [K+2xN] for each variable on each component. Row one up to the number of components shows the UNIQUE variance of components (variance in common has been removed). Row component+1, shows the common variation. The last row is the total variation.

See Also

analysis, pca