Simul subplot question

Dear Prof. Pfeifer,

I am trying to plot my “simul” IRFs using subplot. Everything is fine, except that my simulation goes up to period 100 and the periods displayed on the x-axes all go up to 120 periods, leaving a part of the plot blank.

shocks;
var eps_w; periods 1:9; values 0;
end;	

simul(periods=100);

subplot(3,3,1);
plot(x)
title('X');
subplot(3,3,2);
plot(infl)
title('Inflation');
subplot(3,3,3);
plot(l)
title('Employment');
subplot(3,3,4);
plot(c)
title('C');
subplot(3,3,5);
plot(y)
title('Y');
subplot(3,3,6);
plot(w)
title('w');
subplot(3,3,7);
plot(r)
title('r');
subplot(3,3,8);
plot(tauw)
title('Labour Tax');

Would you know how to fix this simple issue?

Best,

Fabio

use

xlim([0,options_.periods])

Dear Prof. Pfeifer,

Thank you very much, it worked perfectly.

I tried to adapt and use this same code for the stoch_simul version of the model too, to obtain the figures with the same layout, i.e. IRFs distributed in the two figures in the same way (same # columns and # rows). It didn’t work and in the standard way dynare produces stoch_simul plots after the 9th variable it creates another picture with the remaining plots. How do I give more precise instructions of this kind to dynare, of the same kind given in the simul version of the model?

Best,

Fabio

You have to plot things manually using the IRFs stored in oo_.irfs

Looking at some relevant previous posts, I believe I should start a matlab file by typing:

dynare dmp3.mod load('dmp3_results.mat', 'oo_') irf1=oo_.irfs; save irf1 load irf1

but after this point I have no idea about how to proceed in order to produce the subplots I need. Do you have any hint or material I could look at?

Best,

Fabio

Follow e.g. github.com/JohannesPfeifer/DSGE_mod/blob/master/Ireland_2004/Ireland_2004.mod

Many Thanks, I managed to uniform my graphs layout.

Best,

Fabio

Dear sir,
I want to make subplots for my Four variables using your code given in IRF Matching.

figure
subplot(2,1,1)
plot(1:options_.irf,IRF_empirical(:,1),1:options_.irf,IRF_model(:,1),1:options_.irf,IRF_quantiles(1,:,1),‘r–’,1:options_.irf,IRF_quantiles(1,:,2),‘r–’);
title(‘G’)
subplot(2,1,2)
plot(1:options_.irf,IRF_empirical(:,2),1:options_.irf,IRF_model(:,2),1:options_.irf,IRF_quantiles(2,:,1),‘r–’,1:options_.irf,IRF_quantiles(2,:,2),‘r–’);
title(‘Y’)
legend(‘Empirical’,‘Model’)

How it works for four variables?

See the Matlab help on https://de.mathworks.com/help/matlab/ref/subplot.html
and
https://de.mathworks.com/help/matlab/ref/plot.html