lr.var: Calculating long-run variance or covariance matrix

View source: R/lr.var.R

lr.varR Documentation

Calculating long-run variance or covariance matrix

Description

Calculating long-run variance or covariance matrix

Usage

lr.var(
  y,
  demean = TRUE,
  kernel = "bartlett",
  limit.lags = FALSE,
  limit.selector = "kpss-q",
  upper.rho.limit = 0.97,
  upper.lag.limit = 0.8,
  recolor = FALSE,
  max.lag = 0,
  criterion = "bic"
)

lr.var.bartlett(y)

lr.var.quadratic(y)

lr.var.bartlett.AK(y)

lr.var.SPC(y, max.lag = 0, kernel = "bartlett", criterion = "bic")

Arguments

y

A time series of interest.

demean

Whether the demeaning is needed.

kernel

A kernel to be used:

  • truncated: \left\{\begin{array}{ll} 1 & |x| \leq 1 \\ 0 & \textrm{otherwize} \end{array}\right.

  • bartlett: \left\{\begin{array}{ll} 1 - |x| & |x| \leq 1 \\ 0 & \textrm{otherwize} \end{array}\right.

  • parzen: \left\{\begin{array}{ll} 1 - 6 x^2 + 6 {|x|}^3 & |x| \leq 1/2 \\ 2 (1 - |x|)^3 & 1/2 \leq |x| \leq 1 \\ 0 & \textrm{otherwize} \end{array}\right.

  • tukey-hanning: \left\{\begin{array}{ll} (1 + \cos(\pi x))/2 & |x| \leq 1 \\ 0 & \textrm{otherwize} \end{array}\right.

  • quadratic: \frac{25}{12 \pi^2 x^2} \left(\frac{\sin(6 \pi x / 5)}{6 \pi x / 5} - \cos(6 \pi x / 5)\right)

limit.lags

Whether all lags shoult be used in formulae.

limit.selector

Way of limit selection:

  • kpss-q: 4 (T / 100)^{1 / 4}.

  • kpss-m: 12 (T / 100)^{1 / 4}.

  • Andrews: kernel-specific formula from Andrews (1991).

  • Kurozumi: kernel-specific formula from Andrews (1991) with Kurozumi (2002) proposal.

upper.rho.limit

The upper limit for the value or AR-coefficient.

upper.lag.limit

The value used to calculate the upper limit for Kurozumi (2002) proposal.

recolor

Whether the correction by Sul et al. (2005) should be used. This option resets limit.lags to TRUE, and limit.selector to Andrews.

max.lag

Maximum number of lags used in AR regresion during recolorization. Otherwize ignored.

criterion

The information crietreion: bic, aic or lwz.

Details

The code provided is based on the original code by Kurozumi, Sul et al. ported to R.

References

Andrews, Donald W. K. “Heteroskedasticity and Autocorrelation Consistent Covariance Matrix Estimation.” Econometrica 59, no. 3 (1991): 817–58. https://doi.org/10.2307/2938229.

Kurozumi, Eiji. “Testing for Stationarity with a Break.” Journal of Econometrics 108, no. 1 (May 1, 2002): 63–99. https://doi.org/10.1016/S0304-4076(01)00106-3.

Sul, Donggyu, Peter C. B. Phillips, and Chi-Young Choi. “Prewhitening Bias in HAC Estimation.” Oxford Bulletin of Economics and Statistics 67, no. 4 (August 2005): 517–46. https://doi.org/10.1111/j.1468-0084.2005.00130.x.


d9d6ka/RANEPA-R documentation built on May 4, 2024, 7:11 a.m.