Learn R Programming

PDSCE (version 1.0)

band.chol.cv: Banding parameter selection for banding the covariance Cholesky factor.

Description

Selects the banding parameter and computes the banded covariance estimator by banding the covariance Cholesky factor as described by Rothman, Levina, and Zhu (2010).

Usage

band.chol.cv(x, k.vec = NULL, method = c("fast", "safe"), nsplits = 10, 
             n.tr = NULL, quiet = FALSE)

Arguments

Value

A list withsigmathe covariance estimate at the selected banding parameterbest.kthe selected banding parametercv.errthe vector of validation errors, one for each entry in k.veck.vecthe vector of candidate banding parametersn.trThe number of cases used for the training set

Details

method="fast" is much faster than method="safe". See Rothman, Levina, and Zhu (2010).

References

Rothman, A. J., Levina, E., and Zhu, J. (2010). A new approach to Cholesky-based covariance regularization in high dimensions. Biometrika 97(3): 539-550.

See Also

band.chol

Examples

Run this code
set.seed(1)
n=10
p=20
true.cov=diag(p)
true.cov[cbind(1:(p-1), 2:p)]=0.4
true.cov[cbind(2:p, 1:(p-1))]=0.4
eo=eigen(true.cov, symmetric=TRUE)
z=matrix(rnorm(n*p), nrow=n, ncol=p)
x=z%*% tcrossprod(eo$vec*rep(eo$val^(0.5), each=p),eo$vec)
cv.out=band.chol.cv(x=x)
plot(cv.out$k.vec, cv.out$cv.err)
cv.out$best.k
cv.out$sigma

Run the code above in your browser using DataLab