nsprcomp (version 0.5.1-2)

asdev: Additional Explained Standard Deviation

Description

asdev computes the additional standard deviation explained by each principal component, taking into account the possible non-orthogonality of the pseudo-rotation matrix \(\mathbf{W}\).

Usage

asdev(x, w, center = TRUE, scale. = FALSE)

Arguments

x

a numeric data matrix with the observations as rows

w

a numeric data matrix with the principal axes as columns

center

a logical value indicating whether the empirical mean of x should be subtracted. Alternatively, a vector of length equal to the number of columns of x can be supplied. The value is passed to scale.

scale.

a logical value indicating whether the columns of x should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with prcomp. Alternatively, a vector of length equal to the number of columns of x can be supplied. The value is passed to scale.

Value

asdev returns a list with class (nsprcomp, prcomp) containing the following elements:

sdev

the additional standard deviation explained by each component

rotation

copied from the input argument w

x

the scores matrix \(\mathbf{XW}\), containing the principal components as columns (after centering and scaling if requested)

center, scale.

the centering and scaling used

xp

the deflated data matrix corresponding to x

q

an orthonormal basis for the principal subspace

Details

The additional standard deviation of a component is measured after projecting the corresponding principal axis to the ortho-complement space spanned by the previous principal axes. This procedure ensures that the variance explained by non-orthogonal principal axes is not counted multiple times. If the principal axes are pairwise orthogonal (e.g. computed using standard PCA), the additional standard deviations are identical to the standard deviations of the columns of the scores matrix \(\mathbf{XW}\).

asdev is also useful to build a partial PCA model from \(\mathbf{W}\), to be completed with additional components computed using nsprcomp.

References

Mackey, L. (2009) Deflation Methods for Sparse PCA. In Advances in Neural Information Processing Systems (pp. 1017--1024).