Plot IRF with VECM model and exogenous variables

210 Views Asked by At

I need help with irf plots. I am working with R and hope You can help me here. My VECM model consist of three endogen variables and two exogen variables. When I transform vecm to var using vec2var function and try to plot impulse response functions it shows only endogenous variables, because vec2var takes cointegration test results and cointegration was tested between three I(1) variables. So is it possible to plot irf with those exogen variables or not really?

conin_test1 <- ca.jo(df1[,-c(1:8)], type = "trace", ecdet = "none", spec = "longrun",K=3)
summary(conin_test1)

# Estimate
est_tsdyn1 <- VECM(df11, lag = 2, r = 1, include = "none", estim = "2OLS",exogen =df11[,5:6] )

var1 <- vec2var(conin_test1, r = 1)

suppressWarnings({
plot(irf(var1, response = c("log_msci"), impulse = c("log_gdp","log_cci","log_interest_rate"), boot = TRUE,ci=0.95),
ylab = "MSCI")
})

Cointegration data example:

structure(list(log_gdp = c(9.16930371761919, 9.16153844782631, 9.15593804867306, 9.15550618398698, 9.14617836970791, 9.14184924711109, 9.14540201574187, 9.12440511360855, 9.11142813330524, 9.09783929015845, ) log_cci = c(4.61088067478643, 4.60947139496659, 4.60899802366385, 4.60856952712187, 4.60829681096932, 4.60642668373468, 4.6042136177678, 4.6014719210196, 4.59862522265446, 4.59672074578658, 4.59485866328294),log_interest_rate = c(1.58543463315601, 1.58597577939946, 1.58781531919917, 1.5896688687324, 1.5940817499901, 1.59854418019601, 1.56026708176096, 1.49699058931146, 1.47539017968064),log_msci = c(6.84456944255395, 6.86252252970238, 6.90775527898214, 6.90100756427475, 6.871704177299, 6.87145015137558, 6.8793959271123, 6.90139006391453, 6.83998808461743)

VECM data example:

structure(list(log_msci = c(6.84456944255395, 6.86252252970238, 6.90775527898214, 6.90100756427475, 6.871704177299, 6.87145015137558, 6.8793959271123, 6.90139006391453, 6.83998808461743, 6.83243025883356),log_gdp = c(9.16930371761919, 9.16153844782631, 9.15593804867306, 9.15550618398698, 9.14617836970791, 9.14184924711109, 9.14540201574187),log_cci = c(4.61088067478643, 4.60947139496659, 4.60899802366385, 4.60856952712187, 4.60829681096932, 4.60642668373468, 4.6042136177678, 4.6014719210196, 4.59862522265446),log_interest_rate = c(1.58543463315601, 1.58597577939946, 1.58781531919917, 1.5896688687324, 1.5940817499901, 1.59854418019601, 1.56026708176096, 1.49699058931146, 1.47539017968064, 1.45061163253602),trade.balance = c(0.340387867332013, 0.6818520288, 0.875047032469967, 0.971304021850825, 0.850299686568977, 0.911127318093729, 0.809371132261386, 0.908993502310231, 0.889193407366337, 0.731659568052805),inflation = c(2.5863102310231, 2.404699669967, 2.48520132013201, 2.50769636963696, 2.31458745874587, 1.99857425742574, 2.64578217821782, 3.25973597359736, 3.93322772277228)

0

There are 0 best solutions below