Varcap
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.