Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getLongRunVar

Long-Run Variance


Description

This function computes the long-run variance Omega, the one sided long-run variance Delta (starting with lag 0) and the variance Sigma from an input matrix of residuals.

Usage

getLongRunVar(u, bandwidth = c("and", "nw"), kernel = c("ba", "bo", "da",
  "pa", "qs", "tr"), demeaning = FALSE, check = TRUE, ...)

Arguments

u

[numeric | matrix]
Data on which to apply the calculation of the long-run variance.

bandwidth

[numeric(1)]
The bandwidth to use for calculating the long-run variance as a positive intergerish value.

kernel

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

demeaning

[logical]
Demeaning of the data before the calculation (default is FALSE).

check

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

...

Arguments passed to getBandwidthNW.

Details

The bandwidth can be one of the following:

  • "ba": Bartlett kernel

  • "bo": Bohmann kernel

  • "da": Daniell kernel

  • "pa": Parzen kernel

  • "qs": Quadratic Spectral kernel

  • "tr": Truncated kernel

Value

[list] with components:

Omega [matrix]

Long-run variance matrix

Delta [matrix]

One-sided long-run variance matrix

Sigma [matrix]

Variance matrix

See Also

Examples

set.seed(1909)
x <- rnorm(100)
band <- getBandwidthAnd(x, kernel = "ba")
getLongRunVar(x, kernel = "ba", bandwidth = band)
# shorter:
getLongRunVar(x, kernel = "ba", bandwidth = "and")

x2 <- arima.sim(model = list(ar = c(0.7, 0.2)), innov = x, n = 100)
x2 <- cbind(a = x2, b = x2 + rnorm(100))
getLongRunVar(x2, kernel = "ba", bandwidth = "nw")

cointReg

Parameter Estimation and Inference in a Cointegrating Regression

v0.2.0
GPL-3
Authors
Philipp Aschersleben [aut, cre], Martin Wagner [aut] (Author of underlying MATLAB code.)
Initial release
2016-06-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.