getBandwidth: Automatic Bandwidth Selection

Description

Automatic bandwidth selection of Andrews (1991) and of Newey and West (1994).

Usage

1
2
3
4
5
6
getBandwidth(u, bandwidth = c("and", "nw"), kernel, ..., check = TRUE)

getBandwidthAnd(u, kernel = c("ba", "pa", "qs", "th", "tr"), check = TRUE)

getBandwidthNW(u, kernel = c("ba", "pa", "qs"), inter = FALSE,
  u.weights = NULL, check = TRUE)

Arguments

u

[numeric]
Data on which to apply the bandwidth selction.

bandwidth

[character(1)]
The bandwidth selection method to use. Default is Andrews (1991) ("and"), an alternative is Newey West (1994) ("nw").

kernel

[character(1)]
The kernel function to use for selecting the bandwidth. Default is Bartlett kernel ("ba"), see Details for alternatives.

...

Arguments passed to getBandwidthNW.

check

[logical]
Wheather to check (and if necessary convert) the arguments. See checkVars for further information.

inter

[logical]
The first column will be ignored, if TRUE (intercept). Default is FALSE.

u.weights

[numeric]
How to weight the columns of u. If NULL (default), uses identical weights for all columns.

Details

For Andrews (1991), the AR(1) individual version is implemented.

The kernel that is used for calculating the long-run variance can be one of the following:

Value

[numeric(1)]. Bandwidth

Functions

References

See Also

getLongRunVar

Examples

1
2
3
4
5
6
7
8
set.seed(1909)
x <- rnorm(100)
getBandwidth(x, kernel = "ba")
getBandwidth(x, bandwidth = "nw", kernel = "ba")

x2 <- arima.sim(model = list(ar = c(0.7, 0.2)), innov = x, n = 100)
getBandwidth(x2, kernel = "qs")
getBandwidth(x2, bandwidth = "nw", kernel = "qs")

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.