0

When trying to apply the panel VAR impuse response funtion I get the following error:

pvardAF_1_m_data_oirf \<- oirf(pvardAF_1_m, n.ahead=8)

Error in 1:(nrow(Phi) * lags) : argument of length 0

That error does not show up using the same data but different choice of lags and stepts, but this particular case, 1 lag and multistep, is the best solution. I wonder if this has something to do with the warning message I get that

The matrix D_e is singular, therefor the inverse général is used [1] 0,9775323

This is the panel VAR:

pvardAF_1_m \<- pvargmm (dependent_vars=c("kWh_g","employment_g","gdp_g","gfcf_g","houseexp_g","industry_g"),
lags = 1, # Number of lags of dependent variables
predet_vars =,
exog_vars =c("REkWh_g","CREkWh_g_lag1"),
transformation = "fod",  #     First-difference "fd" or forward orthogonal deviations "fod"
data = dAF,
panel_identifier = c("code","year"),  # Vector of panel identifiers
steps = c("mstep"),   # "onestep", "twostep" or "mstep" estimation
system_instruments = TRUE,  #    System GMM estimator
max_instr_dependent_vars =99, #  Maximum number of instruments for dependent variables
min_instr_dependent_vars = 2L, # Minimum number of instruments for dependent variables
max_instr_predet_vars = 99,
min_instr_predet_vars = 1L,
collapse = TRUE,
progressbar= TRUE)
summary(pvardAF_1_m)

I was expecting to get the impulse response results for my panel VAR model

Julian
  • 6,586
  • 2
  • 9
  • 33
  • Welcome to StackOverflow. Can you edit your post to make your question [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for others? – jrcalabrese Dec 02 '22 at 17:33

0 Answers0