Panel vector autoregression models in R? Are there any R packages that can estimate panel vector autoregression (panel VAR, or PVAR) models from pooled time-series data?
I've searched several ways and come up empty. I'm hoping I've overlooked something that you know where to find.
If you're wondering what panel VAR models are and how they might be useful, this paper is not a bad place to start.
 A: There is your solution. Code will be available soon.
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2896087
Panel Vector Autoregression in R: The Panelvar Package:
This paper considers two types of generalized method of moments (GMM) estimators for panel vector autoregression models (PVAR) with fixed individual effects. First, the first difference GMM estimator is implemented. It is an extension of the single equation dynamic panel model. A GMM-estimator for single equation dynamic panel model is implemented in the STATA package xtabond2. Some of the xtabond2 features are covered in the R package: plm. Second, also the so-called system GMM estimator is extended from single equation dynamic panel models to PVAR models. In addition to the GMM-estimators we contribute to the literature by providing specification tests (Hansen overidentification test, lag selection criterion and stability test of the PVAR polynomial) and classical structural analysis for PVAR models such as orthogonal and generalized impulse response functions, bootstrapped confidence intervals for impulse response analysis and forecast error variance decompositions. Finally, we implement the first difference and the forward orthogonal transformation to remove the fixed effects.
A: Christoph Adolph makes it possible:
For panels with long T:
      # Load libraries
      library(nlme)      # Estimation of mixed effects models
      library(lme4)      # Alternative package for mixed effects models
      library(plm)       # Econometrics package for linear panel models
      library(arm)       # Gelman & Hill code for mixed effects simulation
      library(pcse)      # Calculate PCSEs for LS models (Beck & Katz)
      library(tseries)   # For ADF unit root test
      library(simcf)     # For panel functions and simulators
      # Estimate a random effects AR(I)MA(p,q) model using lme (Restricted ML)
      lme.res1 <- lme(# A formula object including the response,
        # the fixed covariates, and any grouping variables
        fixed = GDPWdiff ~ OIL + REG + EDT,

        # The random effects component
        random = ~ 1 | COUNTRY,

        # The TS dynamics: specify the time & group variables,
        # and the order of the ARMA(p,q) process
        correlation = corARMA(form = ~ YEAR | COUNTRY,
                              p = 1,  # AR(p) order
                              q = 0   # MA(q) order
        ) 
      )

