eespcaCV {EESPCA}R Documentation

Cross-validation for Eigenvectors from Eigenvalues Sparse Principal Component Analysis (EESPCA)

Description

Performs cross-validation of EESPCA to determine the optimal sparsity threshold. Selection is based on the minimization of reconstruction error. Based on the cross-validation approach of Witten et al. as implemented by the SPC.cv method in the PMA package.

Usage

    eespcaCV(X, max.iter=20, sparse.threshold.values, nfolds=5, 
        lambda.diff.threshold=1e-6, compute.sparse.lambda=FALSE, 
        sub.mat.max.iter=5, trace=FALSE)

Arguments

X

See description for eespca

max.iter

See description for eespca

sparse.threshold.values

Vector of threshold values to evaluate via cross-validation. See description for eespca for details.

nfolds

Number of cross-validation folds.

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, PMA{SPC.cv}

Examples

    set.seed(1)
    # Simulate 10x5 MVN data matrix
    X=matrix(rnorm(50), nrow=10)
    # Generate range of threshold values to evaluate
    default.threshold = 1/sqrt(5)
    threshold.values = seq(from=.5*default.threshold, to=1.5*default.threshold, length.out=10)
    # Use 5-fold cross-validation to estimate optimal sparsity threshold
    eespcaCV(X=X, sparse.threshold.values=threshold.values)

[Package EESPCA version 0.7.0 Index]