Page 1 of 1

Simul subplot

PostPosted: Fri Aug 05, 2016 2:48 pm
by fabioit
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.

Code: Select all
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

Re: Simul subplot

PostPosted: Fri Aug 05, 2016 4:04 pm
by jpfeifer
use
Code: Select all
xlim([0,options_.periods])

Re: Simul subplot

PostPosted: Sun Aug 07, 2016 3:21 pm
by fabioit
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

Re: Simul subplot

PostPosted: Sun Aug 07, 2016 4:18 pm
by jpfeifer
You have to plot things manually using the IRFs stored in oo_.irfs

Re: Simul subplot

PostPosted: Fri Aug 12, 2016 3:37 pm
by fabioit
Looking at some relevant previous posts, I believe I should start a matlab file by typing:
Code: Select all
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

Re: Simul subplot

PostPosted: Fri Aug 12, 2016 4:55 pm
by jpfeifer

Re: Simul subplot

PostPosted: Sun Aug 14, 2016 10:40 am
by fabioit
Many Thanks, I managed to uniform my graphs layout.

Best,

Fabio