nse.hiruk: Hirukawa NSE estimators.

Description Usage Arguments Details Value References Examples

Description

Calculate the variance of the mean with the kernel based variance estimator by Andrews (1991) using Hirukawa (2010) automatic bandwidth estimator.

Usage

1
nse.hiruk(x, type = c("bartlett", "parzen"), lag.prewhite = 0)

Arguments

x

A numeric vector.

type

The type of kernel used c("Bartlett","Parzen").

lag.prewhite

Prewhite the serie before analysis (integer or NULL, i.e. automatic selection)

Details

This is a wrapper around lrvar from the sandwich package and use Hirukawa (2010) automatic bandwidth estimator.

Value

The variance estimator.

References

Zeileis, Achim. "Econometric computing with HC and HAC covariance matrix estimators." (2004).

Andrews, Donald WK. "Heteroskedasticity and autocorrelation consistent covariance matrix estimation." Econometrica: Journal of the Econometric Society 59.03 (1991): 817-858.

Hirukawa, Masayuki. "A two-stage plug-in bandwidth selection and its implementation for covariance estimation." Econometric Theory 26.03 (2010): 710-743.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n    = 1000
ar   = 0.9
mean = 1
sd   = 1

set.seed(1234) 
x = as.vector(arima.sim(n = n, list(ar = ar), sd = sd) + mean)
 
nse.hiruk(x = x, type = "bartlett", lag.prewhite = 0)
nse.hiruk(x = x, type = "bartlett", lag.prewhite = 1)
nse.hiruk(x = x, type = "bartlett", lag.prewhite = NULL)

nse.hiruk(x = x, type = "parzen", lag.prewhite = 0)
nse.hiruk(x = x, type = "parzen", lag.prewhite = 1)
nse.hiruk(x = x, type = "parzen", lag.prewhite = NULL)

braverock/nse documentation built on May 13, 2019, 5:03 a.m.