eespcaForK: 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.
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.
# NOT RUN { 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)
# }