Description Usage Arguments Value Examples

Estimates a covariance matrix by banding the sample covariance matrix

1 | ```
banded.sample(X, bandwidth, centered = FALSE)
``` |

`X` |
A data matrix with |

`bandwidth` |
A positive integer. Must be less than |

.

`centered` |
Logical. Is data matrix centered? Default is |

A list with

`est` |
The estimated covariance matrix. |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
## set sample size and dimension
n=20
p=100
## create covariance with AR1 structure
Sigma = matrix(0, nrow=p, ncol=p)
for(l in 1:p){
for(m in 1:p){
Sigma[l,m] = .5^(abs(l-m))
}
}
## simulation Normal data
eo1 = eigen(Sigma)
Sigma.sqrt = eo1$vec%*%diag(eo1$val^.5)%*%t(eo1$vec)
X = t(Sigma.sqrt%*%matrix(rnorm(n*p), nrow=p, ncol=n))
## compute estimate
out2 = banded.sample(X, bandwidth=4)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.