banded.chol {FastBandChol}R Documentation

Computes estimate of covariance matrix by banding the Cholesky factor

Description

Computes estimate of covariance matrix by banding the Cholesky factor using a modified Gram Schmidt algorithm implemented in RcppArmadillo.

Usage

banded.chol(X, bandwidth, centered = FALSE)

Arguments

X

A data matrix with n rows and p columns. Rows are assumed to be independent realizations from a p-variate distribution with covariance \Sigma.

bandwidth

A positive integer. Must be less than n-1 and p-1.

centered

Logical. Is data matrix centered? Default is centered = FALSE

Value

A list with

est

The estimated covariance matrix.

Examples

## 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
out1 = banded.chol(X, bandwidth=4)

[Package FastBandChol version 0.1.1 Index]