Learn R Programming

mdatools (version 0.9.1)

ldecomp: Linear decomposition of data

Description

Creates an object of ldecomp class.

Usage

ldecomp(scores = NULL, residuals = NULL, loadings = NULL,
  ncomp.selected = NULL, attrs = NULL, tnorm = NULL, dist = NULL,
  var = NULL, cal = FALSE, totvar = NULL)

Arguments

scores

matrix with score values (nobj x ncomp).

residuals

matrix with data residuals

loadings

matrix with loading values (nvar x ncomp).

ncomp.selected

number of selected components

attrs

list with attributes of original dataset

tnorm

singular values for score normalization

dist

list with calculated T2 and Q values (e.g. for CV)

var

list with explained and cumulative explained variance (e.g. for CV)

cal

logical, true if data is for calibration of a LDECOMP based model

totvar

full variance of original data, preprocessed and centered

Value

Returns an object (list) of ldecomp class with following fields:

scores

matrix with score values (nobj x ncomp).

residuals

matrix with data residuals (nobj x nvar).

T2

matrix with T2 distances (nobj x ncomp).

Q

matrix with Q statistic (nobj x ncomp).

tnorm

vector with singular values used for scores normalization.

ncomp.selected

selected number of components.

expvar

explained variance for each component.

cumexpvar

cumulative explained variance.

modpower

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