Apply Kfold crossvalidation for selecting tuning parameters for thresholding covariance matrix using grid search strategy
1 2  threshold.cv(matrix, method = "hard", thresh.len = 20, n.cv = 10,
norm = "F", seed = 142857)

matrix 
a N*p matrix, N indicates sample size and p indicates the dimension 
method 
thresholding method, "hard" or "soft" 
thresh.len 
the number of thresholding values tested in
crossvalidation, the thresholding values will be a sequence of

n.cv 
times that crossvalidation repeated, the default number is 10 
norm 
the norms used to measure the crossvalidation errors, which can be the Frobenius norm "F" or the operator norm "O" 
seed 
random seed, the default value is 142857 
For crossvalidation, this function split the sample randomly into two pieces of size n1 = nn/log(n) and n2 = n/log(n), and repeat this k times
An object of class "CovCv" containing the crossvalidation's result for covariance matrix regularization, including:
regularization 
regularization method, which is "Hard Thresholding" or "Soft Thresholding" 
parameter.opt 
selected optimal parameter by crossvalidation 
cv.error 
the corresponding crossvalidation errors 
n.cv 
times that crossvalidation repeated 
norm 
the norm used to measure the crossvalidation error 
seed 
random seed 
threshold.grid 
thresholding values tested in crossvalidation 
"HighDimensional Covariance Estimation" by Mohsen Pourahmadi
1 2 3 4 5 6  data(m.excess.c10sp9003)
retcov.cv < threshold.cv(m.excess.c10sp9003, method = "hard",
thresh.len = 20, n.cv = 10, norm = "F", seed = 142857)
summary(retcov.cv)
plot(retcov.cv)
# Low dimension

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.