Learn R Programming

nse (version 1.21)

nse.hiruk: Hirukawa estimator

Description

Function which calculates the numerical standard error with the kernel based variance estimator by Andrews (1991) using Hirukawa (2010) automatic bandwidth estimator.

Usage

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

Value

The NSE estimator.

Arguments

x

A numeric vector.

type

The type of kernel used among "bartlett" and "parzen". Default is type = "Bartlett".

lag.prewhite

Prewhite the series before analysis (integer or NULL). When lag.prewhite = NULL this performs automatic lag selection. Default is lag.prewhite = 0 that is no prewhitening.

Author

David Ardia and Keven Bluteau

References

Hirukawa, M. (2010). A two-stage plug-in bandwidth selection and its implementation for covariance estimation. Econometric Theory 26(3), 710-743.

Examples

Run this code
if (FALSE) {
n    = 1000
ar   = 0.9
mean = 1
sd   = 1

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

Run the code above in your browser using DataLab