Usage
kernHAC(x, order.by = NULL, prewhite = 1, bw = NULL,
kernel = c("Quadratic Spectral", "Truncated", "Bartlett", "Parzen", "Tukey-Hanning"),
approx = c("AR(1)", "ARMA(1,1)"), diagnostics = FALSE, sandwich = TRUE, data = list(), ...)weightsAndrews(x, order.by = NULL, bw = NULL,
kernel = c("Quadratic Spectral", "Truncated", "Bartlett", "Parzen", "Tukey-Hanning"),
prewhite = 1, data = list(), ...)
bwAndrews(x, order.by = NULL, kernel = c("Quadratic Spectral", "Truncated",
"Bartlett", "Parzen", "Tukey-Hanning"), approx = c("AR(1)", "ARMA(1,1)"),
weights = NULL, prewhite = 1, data = list())
Arguments
x
a fitted model object of class "lm"
or "glm"
.
order.by
Either a vector z
or a formula with a single explanatory
variable like ~ z
. The observations in the model
are ordered by the size of z
. If set to NULL
(the
default) the observations are assum
prewhite
logical or integer. Should the estimating functions
be prewhitened? If TRUE
or greater than 0 a VAR model of
order as.integer(prewhite)
is fitted via ar
with
method "ols"
and demean = F
bw
numeric. The bandwidth of the kernel (corresponds to the
truncation lag). If set to NULL
(the default) it is adaptively
chosen by the function bwAndrews
.
kernel
a character specifying the kernel used. All kernels used
are described in Andrews (1991).
approx
a character specifying the approximation method if the
bandwidth bw
has to be chosen by bwAndrews
.
diagnostics
logical. Should additional model diagnostics be returned?
See vcovHAC
for details. sandwich
logical. Should the sandwich estimator be computed?
If set to FALSE
only the middle matrix is returned.
data
an optional data frame containing the variables in the order.by
model. By default the variables are taken from the environment which
the function is called from.
...
further arguments passed to bwAndrews
.
weights
numeric. A vector of weights used for weighting the estimated
coefficients of the approximation model (as specified by approx
). By
default all weights are 1 except that for the intercept term (if there is more than
one variable).