lr_var {pretest}R Documentation

Heteroskedastic Long run variance

Description

Long-run covariance estimation using Newey-West (Bartlett) weights

Usage

lr_var(u, nlag = NULL, demean = TRUE)

Arguments

u

P by K vector of residual series, for which we recommend to use the recursive residuals from larger model.

nlag

Non-negative integer containing the lag length to use. If empty or not included, nleg = min(floor(1.2*T^(1/3)),T) will be used.

demean

Logical true of false (0 or 1) indicating whether the mean should be subtracted when computing.

Details

Copyright: Kevin Sheppard Kevin.sheppard\@economics.ox.ac.uk Revision: 3 Date: 5/1/2007

Value

K by K vector of Long run variance using Newey-West (Bartlett) weights.

Examples

x<- rnorm(15);
#Newey-West covariance with automatic BW selection
lrcov = lr_var(x)
#Newey-West covariance with 10 lags
lrcov = lr_var(x, 10)
#Newey-West covariance with 10 lags and no demeaning
lrcov = lr_var(x, 10, 0)

[Package pretest version 0.2 Index]