I want to plot response to two different shocks (e_v and e_g) in the same plot, not two different subplots. I could not manage to modify the code below to achieve what I want. Could you please help? Thank you.
dynare cap
load('cap.mat', 'oo_')
irf1=oo_.irfs;
save irf1
load irf1
ending_cell={'_e_v','_e_g'};
for ii=1:length(ending_cell)
HOR=1:options_.irf;
var={'yy','nx','cc','ii','nn', 'kk','u', 'a','r'};
figure
for jj=1:length(var)
subplot(2,4,jj,'align')
eval(['irf1.' var{1,jj},ending_cell{1,ii}]);
hold on
plot(HOR,[eval(['irf1.' var{1,jj},ending_cell{1,ii}])],'-k','LineWidth',1);
title([var{1,jj}] )
end
end
Sir, IRF’s are plotted such that the shock is given at t=1. I know that IRF’s are stored that way. But I want to plot the IRF’s as if the shock is given at t=0. I mean, I just want to change the values in the x-axis in the IRF’s. Is there a quick way that I can manipulate the code you sent above?