Introducing shocks in a VAR
Posted: Wed Oct 23, 2024 9:58 pm
Hello,
I have been trying to introduce shocks in a 6 Variable VAR with Exogenous variables to simulate the effects of interest rate decisions in GDP and CPI.I have monthly data from 1997:1 to 2024:7.
*VAR Setup
*Forecast until 2026:6
At this point, I wanted to see the effect of two consecutive interest rate drops in the forecast of both CPI and GDP, one in October for 50 bps and another in December of 25 bps. I tried doing in with a loop but it didn't work.
*Introduction of shocks to simulate interest rate decisions from central banks
I was wondering if anyone had suggestions on how I could do something like this? I am relatively new to coding
I have been trying to introduce shocks in a 6 Variable VAR with Exogenous variables to simulate the effects of interest rate decisions in GDP and CPI.I have monthly data from 1997:1 to 2024:7.
*VAR Setup
Code: Select all
system(model=canvar2)
variables rgdpagr cpiagr t0yrate n0ebill exrateagr m1ppagr
lags 1 to 3
det constant rgdpgrus cpigrus n0ebillus t0yrateus m1ppgrus popexogenousgr wtiexogenousgr
end(system)
estimate(resids=residsexo)Code: Select all
forecast(model=canvar2,steps=24,from=2024:07,results=canvar2_fore)
*Introduction of shocks to simulate interest rate decisions from central banks
Code: Select all
do t = 2024:7, 2026:06
if t == 2024:10
compute shocks = ||0, 0, 0, -0.5, 0, 0|| ;
elseif t == 2024:12
compute shocks = ||0, 0, 0, -0.25, 0, 0|| ;
else
compute shocks = ||0, 0, 0, 0, 0, 0|| ;
endif
forecast(model=canvar2, from=t, to=t, result=canvar2shocktest, shock=shocks)
end do t