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, prewhite = FALSE, type = "Bartlett")

Arguments

x

A numeric vector.

prewhite

A bool indicating if the time-serie will be prewhitened before analysis.

type

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

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
n = 1000
ar = c(0.9)
mean = c(1)
sd = c(10)
 
Ts1 = as.vector(arima.sim(n = n, list(ar = ar), sd = sd) + mean)
 
nse::nse.hiruk(x = Ts1, type = "Bartlett")
nse::nse.hiruk(x = Ts1, prewhite = TRUE, type = "Bartlett")
 
nse::nse.hiruk(x = Ts1, type = "Parzen")
nse::nse.hiruk(x = Ts1, prewhite = TRUE, type = "Parzen")

AmurG/nse documentation built on May 5, 2019, 4:56 a.m.