eespcaForK {EESPCA}R Documentation

Multi-PC version of Eigenvectors from Eigenvalues Sparse Principal Component Analysis (EESPCA)

Description

Computes multiple sparse principal components of the specified data matrix via sequential application of the Eigenvectors from Eigenvalues Sparse Principal Component Analysis (EESPCA) algorithm. After computing the first sparse PC via the eespca function, subsequent sparse PCs are computing by repeatedly applying eespca to the residual matrix formed by subtracting the reconstruction of X from the original X. Multiple sparse PCs are not guaranteed to be orthogonal.

Note that the accuracy of the sparse approximation declines substantially for PCs with very small variances. To avoid this issue, k should not be set higher than the number of statistically significant PCs according to a Tracey-Widom test.

Usage

    eespcaForK(X, k=2, max.iter=20, sparse.threshold, lambda.diff.threshold=1e-6, 
        compute.sparse.lambda=FALSE, sub.mat.max.iter=5, trace=FALSE)

Arguments

X

An n-by-p data matrix for which the first k sparse PCs will be computed.

k

The number of sparse PCs to compute. The specified k must be 2 or greater (for k=1, use the eespca method). A check is made that k is not greater than the maximum theoretical rank of X but, for performance reasons, a check is NOT made that k is less than or equal to the actual rank of X.

max.iter

See description for eespca

sparse.threshold

See description for eespca

lambda.diff.threshold

See description for eespca

compute.sparse.lambda

See description for eespca

sub.mat.max.iter

See description for eespca

trace

See description for eespca

Value

A list with the following elements:

References

See Also

eespca

Examples

    set.seed(1)
    # Simulate 10x5 MVN data matrix
    X=matrix(rnorm(50), nrow=10)
    # Get first two sparse PCs
    eespcaForK(X=X, sparse.threshold=1/sqrt(5), k=2)

[Package EESPCA version 0.7.0 Index]