Simul subplot

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Simul subplot

Postby fabioit » Fri Aug 05, 2016 2:48 pm

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
fabioit
 
Posts: 20
Joined: Fri Jul 08, 2016 10:21 am

Re: Simul subplot

Postby jpfeifer » Fri Aug 05, 2016 4:04 pm

use
Code: Select all
xlim([0,options_.periods])
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Simul subplot

Postby fabioit » Sun Aug 07, 2016 3:21 pm

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
fabioit
 
Posts: 20
Joined: Fri Jul 08, 2016 10:21 am

Re: Simul subplot

Postby jpfeifer » Sun Aug 07, 2016 4:18 pm

You have to plot things manually using the IRFs stored in oo_.irfs
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Simul subplot

Postby fabioit » Fri Aug 12, 2016 3:37 pm

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
fabioit
 
Posts: 20
Joined: Fri Jul 08, 2016 10:21 am

Re: Simul subplot

Postby jpfeifer » Fri Aug 12, 2016 4:55 pm

------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Simul subplot

Postby fabioit » Sun Aug 14, 2016 10:40 am

Many Thanks, I managed to uniform my graphs layout.

Best,

Fabio
fabioit
 
Posts: 20
Joined: Fri Jul 08, 2016 10:21 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests