questions on graphics

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.

questions on graphics

Postby np2333 » Tue Aug 05, 2014 5:15 am

Hi,

1. After estimating a model, i want to recreate the bayesian irf graphs with confidence intervals (example attached) that are printed along with the output. I tried looking into oo_.PosteriorIRF.dsge but it didnt have the option of "distribution" (the screenshot is attached). If i remember correctly an earlier version of dynare had this option. Has it been moved elsewhere?

2. secondly, when i run my estimation without the "nograph" command i encounter the following error. Any suggestions?


Error using f1
Too many output arguments.

Error in PlotPosteriorDistributions (line 135)
top1 = max(f1);

Error in dynare_estimation_1 (line 804)
oo_ = PlotPosteriorDistributions(estim_params_, M_,
options_, bayestopt_, oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in mp_cc5 (line 525)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;
Attachments
Screen Shot.pdf
(55.51 KiB) Downloaded 136 times
Bayesian_IRF_EPS_A_1.pdf
(8.7 KiB) Downloaded 101 times
np2333
 
Posts: 29
Joined: Fri May 31, 2013 11:00 pm

Re: questions on graphics

Postby jpfeifer » Tue Aug 05, 2014 9:41 am

1. Everything you are looking for is there. You have both the deciles and the lower and upper bounds of the HPDIs.
2. Try the most recent unstable version. If the problem persists, provide the mod-file and the data-file.
------------
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: questions on graphics

Postby np2333 » Tue Aug 05, 2014 10:57 am

Hi Johannes,

thanks a lot for the response.

1. I realize that all the information is there, but is there a way to create the graph in the same format (with the bands instead of just lines). Maybe there is a matlab file in the dynare package that i can turn to to get guidance on how to plot such graphs outside of dynare?

2. I tried both the unstable and the latest stable release(4.4.3) but the problem persists. The mod file is attached. Please also find the links to the data and mode file below (i couldn't attach them here)

https://dl.dropboxusercontent.com/u/144 ... ta_aug.mat
https://dl.dropboxusercontent.com/u/144 ... 6_mode.mat

thanks again!
Attachments
mp_cc6.mod
(12.73 KiB) Downloaded 97 times
np2333
 
Posts: 29
Joined: Fri May 31, 2013 11:00 pm

Re: questions on graphics

Postby jpfeifer » Tue Aug 05, 2014 12:23 pm

You need to use Matlab's area plot. The Dynare code for the IRFs is
Code: Select all
                h1 = area(1:options_.irf,HPDIRF(:,2,j,i));
                set(h1,'FaceColor',[.9 .9 .9]);
                set(h1,'BaseValue',min([min(HPDIRF(:,1,j,i)),min(HPDIRFdsgevar(:,1,j,i))]));
                hold on;
                h2 = area(1:options_.irf,HPDIRF(:,1,j,i));
                set(h2,'FaceColor',[1 1 1]);
                set(h2,'BaseValue',min([min(HPDIRF(:,1,j,i)),min(HPDIRFdsgevar(:,1,j,i))]));
                plot(1:options_.irf,MeanIRF(:,j,i),'-k','linewidth',3)
                % plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
                plot(1:options_.irf,MeanIRFdsgevar(:,j,i),'--k','linewidth',2)
                plot(1:options_.irf,HPDIRFdsgevar(:,1,j,i),'--k','linewidth',1)
                plot(1:options_.irf,HPDIRFdsgevar(:,2,j,i),'--k','linewidth',1)
                box on
                axis tight
                xlim([1 options_.irf]);
                hold off

2. The error message indicates a naming conflict. You seem to have a file called f1 present in your path. Try typing
Code: Select all
which f1

into the command window to identify where this file is. I cannot replicate your problem.
------------
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: questions on graphics

Postby np2333 » Tue Aug 05, 2014 12:57 pm

thanks a lot!
np2333
 
Posts: 29
Joined: Fri May 31, 2013 11:00 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests