nse.andrews: Andrews estimator

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/nse.R

Description

Function which calculates the numerical standard error with the kernel based variance estimator by Andrews (1991).

Usage

1
2
3
4
5
6
nse.andrews(
  x,
  type = c("bartlett", "parzen", "tukey", "qs", "trunc"),
  lag.prewhite = 0,
  approx = c("AR(1)", "ARMA(1,1)")
)

Arguments

x

A numeric vector.

type

The type of kernel used among which "bartlett", "parzen", "qs", "trunc" and "tukey". 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.

approx

Andrews approximation, either "AR(1)" or "ARMA(1,1)". Default is approx = "AR(1)".

Details

This kernel based variance estimation apply weight to the auto-covariance function with a kernel and sums up the value.

Value

The NSE estimator.

Note

nse.andrews is a wrapper around lrvar from the sandwich package and uses Andrews (1991) automatic bandwidth estimator. See the documentation of sandwich for details.

Author(s)

David Ardia and Keven Bluteau

References

Andrews, D.W.K. (1991). Heteroskedasticity and autocorrelation consistent covariance matrix estimation. Econometrica 59(3), 817-858.

Andrews, D.W.K, Monahan, J.C. (1992). An improved heteroskedasticity and autocorrelation consistent covariance matrix estimator. Econometrica 60(4), 953-966.

Newey, W.K., West, K.D. (1987). A simple, positive semi-definite, heteroskedasticity and autocorrelationconsistent covariance matrix. Econometrica 55(3), 703-708.

Newey, W.K., West, K.D. (1994) . Automatic lag selection in covariance matrix estimation. Review of Economic Studies 61(4), 631-653.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
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.andrews(x = x, type = "parzen", lag.prewhite = 0)
nse.andrews(x = x, type = "tukey", lag.prewhite = 1)
nse.andrews(x = x, type = "qs", lag.prewhite = NULL)

## End(Not run)

nse documentation built on April 26, 2021, 1:06 a.m.

Related to nse.andrews in nse...