Residual-Based Fully Modified Vector Autoregression
Overview
Implements the Residual-Based Fully Modified Vector Autoregression (RBFM-VAR) estimator of Chang (2000) doi:10.1017/S0266466600166058. 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. Provides automatic lag selection via information criteria (AIC, BIC, HQ), long-run variance estimation using Bartlett, Parzen, or Quadratic Spectral kernels with Andrews (1991) doi:10.2307/2938229 automatic bandwidth selection, Granger non-causality testing with asymptotically chi-squared Wald statistics, impulse response functions (IRF) with bootstrap confidence intervals, forecast error variance decomposition (FEVD), and out-of-sample forecasting.
- The estimator now implements the RBFM-VAR correction of Chang (2000, equations 10 to 13). Previous versions used the OLS residuals in place of the process v_t of equation (11), computed the long-run covariance of the residuals instead of the cross covariance with v_t, and spread the row means of a correction matrix over all nonstationary regressors, so the reported "FM+" coefficients were not the RBFM-VAR estimates. The correction is now (Y'Z, Y+'W + T Delta+)(X'X)^{-1} with Y+' = Y' - Omega_ev Omega_vv^{-1} V', Delta+ = Omega_ev Omega_vv^{-1} Delta_vDw, v_t = (D2 y_{t-1}, D y_{t-1} - N D y_{t-2}) and Dw_t = (D2 y_{t-1}, D y_{t-1}). A test reproduces the formula directly. With the data generating process of Chang (2000, Section 5), the OLS biases match Table 1 of the paper and the RBFM-VAR biases have the same signs and orders of magnitude; the paper does not state the kernel or bandwidth it used, so exact replication is not possible.
- The estimation sample now starts at t = max(p + 1, 4) (the levels VAR(p) needs y_{t-p} and v_t needs D y_{t-2}).
- New internal
estimate_cross_lrv();estimate_onesided_lrv()sums k(j/K) T^{-1} sum_t a_{t+j} b_t' as in the convention of Chang (2000, p. 909); the Quadratic Spectral kernel now uses all lags (its weights do not vanish beyond the bandwidth). The automatic bandwidth is Andrews (1991) applied to v_t. granger_test(): the modified Wald statistic ignored the covariances between the tested coefficients (it summed squared t ratios). It now uses Sigma_e[i, i] (X'X)^{-1} for the tested block (Chang, 2000, eq. 20); the chi-square p-value is conservative (Theorem 2).irf(): the responses used only Pi_1 as a VAR(1) matrix, and the "bootstrap" intervals added random noise to the point estimates. The responses are now those of the levels VAR implied by the estimates, and the intervals come from a recursive-design residual bootstrap that re-estimates the model.fevd()inherits the correction.forecast(): forecasts were Pi_1 times the last fitted second difference. They are now level forecasts from the implied levels VAR, with the forecast error variance sum Psi_i Sigma_e Psi_i'.ic_table()returned nothing; it now reports the criteria from the stored data. Lag selection compares all lag orders on a common sample and counts n p parameters per equation (there is no constant).- The fitted object now also contains
data,XtX_invandN_hat.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-08
- NOTE12 OK, 1 NOTE2026-06-07
- OK6 OK2026-04-10
Documentation
- Help pages
- 37 (19 internal)includes a package overview page
- Examples that run
- 71%5 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 86%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 27%
Downloads
Repository
Stars over time
Releases over time
Commits over time
Commit identities over time
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/muhammedalkhalaf/rbfmvar on 2026-10-21.
The repository owner accepts GitHub Sponsors
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-09-27Commits: at least 3 crediting it in the message
- Claude Fable 5.12 commits · Sep 2026
- Claude Opus 5.51 commit · Sep 2026
Dependencies
Installing rbfmvar adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 2.1.0Latest
- RR 4.6.0 released · 2026-04-24
- 2.0.22026-04-09
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-04-09
- Total releases
- 2 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 35 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("rbfmvar")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.32614/cran.package.rbfmvar.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.