nse.nw {nse} | R Documentation |
Newey-West estimator
Description
Function which calculates the numerical standard error with the Newey West (1987, 1994) HAC estimator.
Usage
nse.nw(x, lag.prewhite = 0)
Arguments
x |
A numeric vector |
lag.prewhite |
Prewhite the series before analysis (integer or |
Value
The NSE estimator.
Note
nse.nw
is a wrapper around lrvar
from
the sandwich
package. See the documentation of sandwich
for details.
Author(s)
David Ardia and Keven Bluteau
References
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
## 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.nw(x = x, lag.prewhite = 0)
nse.nw(x = x, lag.prewhite = 1)
nse.nw(x = x, lag.prewhite = NULL)
## End(Not run)
[Package nse version 1.21 Index]