Learn R Programming

mdatools (version 0.5.3)

ldecomp: Linear decomposition of data

Description

Creates an object of ldecomp class.

Usage

ldecomp(scores = NULL, loadings = NULL, residuals = NULL, totvar,
  tnorm = NULL, ncomp.selected = NULL, T2 = NULL, Q2 = NULL,
  cal = TRUE)

Arguments

scores
matrix with score values (nobj x ncomp).
loadings
matrix with loading values (nvar x ncomp).
residuals
matrix with data residuals
totvar
full variance of original data, preprocessed and centered
tnorm
singular values for score normalization
ncomp.selected
number of selected components
T2
matrix with calculated T2 values (e.g. for CV)
Q2
matrix with calculated Q2 values (e.g. for CV)
cal
logical, true if data is for calibration of a LDECOMP based model

Value

  • Returns an object (list) of ldecomp class with following fields:
  • scoresmatrix with score values (nobj x ncomp).
  • residualsmatrix with data residuals (nobj x nvar).
  • T2matrix with T2 distances (nobj x ncomp).
  • Q2matrix with Q2 distances (nobj x ncomp).
  • tnormvector with singular values used for scores normalization.
  • ncomp.selectedselected number of components.
  • expvarexplained variance for each component.
  • cumexpvarcumulative explained variance.
  • modpowermodelling power of variables.

Details

ldecomp is a general class for decomposition X = TP' + E. Here, X is a data matrix, T - matrix with scores, P - matrix with loadings and E - matrix with residuals. It is used, for example, for PCA results (pcares), in PLS and other methods. The class also includes methods for calculation and plotting residuals, variances, and so on.

There is no need to use the ldecomp manually. For example, when build PCA model with pca or apply it to a new data, the results will automatically inherit all methods of ldecomp.