rbfmvar: Residual-Based Fully Modified Vector Autoregression

CRAN status

Overview

rbfmvar implements the Residual-Based Fully Modified Vector Autoregression (RBFM-VAR) estimator following Chang (2000). The RBFM-VAR procedure extends Phillips (1995) FM-VAR to handle any unknown mixture of I(0), I(1), and I(2) components without prior knowledge of the number or location of unit roots.

Key Features

Installation

Install from CRAN:

install.packages("rbfmvar")

Or install the development version from GitHub:

# install.packages("devtools")

Usage

Basic Estimation

library(rbfmvar)

# Simulate some VAR data
set.seed(123)
n <- 200
y <- matrix(0, n, 3)
colnames(y) <- c("gdp", "inflation", "interest")
e <- matrix(rnorm(n * 3), n, 3)

for (t in 3:n) {
  y[t, ] <- 0.5 * y[t-1, ] + 0.2 * y[t-2, ] + e[t, ]
}

# Estimate RBFM-VAR with automatic lag selection
fit <- rbfmvar(y, max_lags = 6, ic = "bic", kernel = "bartlett")
summary(fit)

Granger Causality Testing

# Test if gdp Granger-causes inflation
granger_test(fit, cause = "gdp", effect = "inflation")

# Pairwise Granger causality matrix
granger_matrix(fit)

Impulse Response Functions

# Compute IRF with bootstrap confidence intervals
ir <- irf(fit, horizon = 20, boot = 500, ci = 95)
plot(ir)

Forecast Error Variance Decomposition

fv <- fevd(fit, horizon = 20)
plot(fv)

Forecasting

fc <- forecast(fit, h = 12)
plot(fc)

Methodology

The RBFM-VAR model is based on Chang (2000), which develops a fully modified VAR estimation procedure that is robust to unknown integration orders. The key innovation is using second differences to eliminate I(2) trends while applying FM corrections to handle endogeneity from I(1) regressors.

The model is specified as:

\[\Delta^2 y_t = \sum_{j=1}^{p-2} \Gamma_j \Delta^2 y_{t-j} + \Pi_1 \Delta y_{t-1} + \Pi_2 y_{t-1} + e_t\]

The FM+ estimator corrects for the asymptotic bias from the correlation between regression errors and innovations in integrated regressors, achieving:

References

License

GPL (>= 3)

Author