band.chol  R Documentation 
Computes the kbanded covariance estimator by kbanding the covariance Cholesky factor as described by Rothman, Levina, and Zhu (2010).
band.chol(x, k, centered = FALSE, method = c("fast", "safe"))
x 
A data matrix with n rows and p columns. The rows are assumed to be a realization of n independent copies of a pvariate random vector. 
k 
The banding parameter (the number of subdiagonals to keep as nonzero). Should be a nonnegative integer. 
centered 
Logical: 
method 
The method to use. The default is

method="fast"
is much faster than method="safe"
.
See Rothman, Levina, and Zhu (2010).
The banded covariance estimate (a p by p matrix).
Adam J. Rothman
Rothman, A. J., Levina, E., and Zhu, J. (2010). A new approach to Choleskybased covariance regularization in high dimensions. Biometrika 97(3): 539550.
band.chol.cv
set.seed(1) n=50 p=20 true.cov=diag(p) true.cov[cbind(1:(p1), 2:p)]=0.4 true.cov[cbind(2:p, 1:(p1))]=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) sigma=band.chol(x=x, k=1) sigma
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.