cv.thresPPP {bspcov} | R Documentation |
CV for Bayesian Estimation of a Sparse Covariance Matrix
Description
Performs cross-validation to estimate spectral norm error for a post-processed posterior of a sparse covariance matrix.
Usage
cv.thresPPP(
X,
thresvec,
epsvec,
prior = NULL,
thresfun = "hard",
nsample = 2000,
ncores = 2
)
Arguments
X |
a n |
thresvec |
a vector of real numbers specifying the parameter of the threshold function. |
epsvec |
a vector of small positive numbers decreasing to |
prior |
a list giving the prior information.
The list includes the following parameters (with default values in parentheses):
|
thresfun |
a string to specify the type of threshold function. |
nsample |
a scalar value giving the number of the post-processed posterior samples. |
ncores |
a scalar value giving the number of CPU cores. |
Details
Given a set of train data and validation data, the spectral norm error for each and
is estimated as follows:
where is the estimate for the covariance based on the train data and
is the sample covariance matrix based on the validation data.
The spectral norm error is estimated by the
-fold cross-validation.
For more details, see the first paragraph on page 9 in Lee and Lee (2023).
Value
CVdf |
a M |
Author(s)
Kwangmin Lee
References
Lee, K. and Lee, J. (2023), "Post-processes posteriors for sparse covariances", Journal of Econometrics, 236(3), 105475.
See Also
thresPPP
Examples
Sigma0 <- diag(1,50)
X <- mvtnorm::rmvnorm(25,sigma = Sigma0)
thresvec <- c(0.01,0.1)
epsvec <- c(0.01,0.1)
res <- bspcov::cv.thresPPP(X,thresvec,epsvec,nsample=100)
plot(res)