SandwichNeweyWest: HAC Variance Covariance Matrix For 'HARModel' Objects

SandwichNeweyWestR Documentation

HAC Variance Covariance Matrix For HARModel Objects

Description

A method for extracting the Newey-West variance-covariance matrix for a HARModel object

Usage

SandwichNeweyWest(object, lags)

Arguments

object

A HARModel object

lags

An integer to denote the allowed autocorrelation.

Details

Usual values for lags are 5 and T^0.25 rounding to the nearest integer. This function is merely a method to implement code from the sandwich package.

Value

HACMatrix

The Variance-Covariance matrix

References

sandwich package. https://CRAN.R-project.org/package=sandwich

Examples

set.seed(123)
#Simulate a HAR process:
HARSim = HARsimulate(iLength = 10000, 
vLags = c(1,5,22), vCoef = c(0., 0.36 , 0.28 , 0.28 ) 
, dSigma = 0.001)
#Estimate the HAR process:
HARModel = HARestimate(vRealizedMeasure = HARSim@Simulation,
vLags = c(1,5,22))

SandwichNeweyWest(HARModel , lags = 5)

emilsjoerup/HARModel documentation built on Jan. 24, 2023, 12:17 a.m.