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)
Run the code above in your browser using DataLab