Page 1 of 1

Combine impulse response functions

PostPosted: Tue Dec 08, 2009 9:21 pm
by Tartaglia
Hi,

is there a command in order to combine impulse response functions from two different calculations, so they are displayed in one diagram (overlapping)?

Thank you
Tartaglia

Re: Combine impulse response functions

PostPosted: Wed Dec 09, 2009 10:26 am
by AssiaEzzeroug
Hi,

you can use the "subplot" matlab command to obtain such a result. For that, you'll need to load the simulated series of the variables u r interested in. They are stored in oo_.endo_simul.

Hope this helps

Re: Combine impulse response functions

PostPosted: Wed Dec 09, 2009 7:12 pm
by Tartaglia
I am not very familiar with matlab, but after looking subplot up in the manual it sounded like I had to divide the panes into subpanes, is that necessary. I am not really sure what my command line would look like: subplot

(m,n,p, 'replace')??

Re: Combine impulse response functions

PostPosted: Wed Dec 09, 2009 11:22 pm
by Tartaglia
Does it store the results in the same folder where the mod-file is in? Because in that folder I have only found a matlab-figure file called: modelname_IRF_shockedvariable.fig, is this the one?

Re: Combine impulse response functions

PostPosted: Thu Dec 10, 2009 10:01 am
by AssiaEzzeroug
Hi,

Your simulations results are stored in oo_ . then go to the matlab command window, and load this mat file like this "load oo_" (first check that the path is correct, means u r in the right repertory). It should appear now in the workspace. You can double-click on it to look at its different fields or just write "oo_" in the command window. Now you should see the field "endo_simul" which is consisted of all the simulated variables series.
For instance you may wanna plot, let's say the variable "Y", then type this: "plot(oo_.endo_simul.Y)".
You have to do the same with your other repertory, and finally use the matlab command "subplot". (Maybe you better rename the mat file oo_ by oo_model1 to avoid potential conflicts).

Hope this helps.

Re: Combine impulse response functions

PostPosted: Thu Dec 10, 2009 10:19 am
by Tartaglia
I am sorry, I could not find any file that contained oo_ . endo_simul in it??? Could it maybe called differently?

In the Dynare Guide it also says that the file is called oo_, but for the life of me I can not find it???

Re: Combine impulse response functions

PostPosted: Thu Dec 10, 2009 11:34 am
by pakocica
Tartaglia,
try to load the file filename_results.mat.

Good luck!
Pavel

Re: Combine impulse response functions

PostPosted: Thu Dec 10, 2009 11:47 am
by AssiaEzzeroug
Sorry I forgot to precise that oo_ is stored indeed in the mat file "filename_results.mat".

Best

Re: Combine impulse response functions

PostPosted: Thu Dec 10, 2009 2:13 pm
by Tartaglia
Ohhhh yeah, now it did work, thanks so much. I'll try the plotting now!!

Thank you so much for your help.

Tartaglia

Re: Combine impulse response functions

PostPosted: Fri Jun 22, 2012 1:43 pm
by ericlearndynare
Hi everybody!

Maybe it's a silly question, I have done the simulation, but don't know how to load specific simulated variable.
After "load trial_results.mat" and "load oo_.endo_simul", it's a big matrix presented in the workspace, i want to abstract one by one, le't say the variable "y", what should i do?

eric

Re: Combine impulse response functions

PostPosted: Fri Jun 22, 2012 3:16 pm
by jpfeifer
After running the simulations, there should be a bunch of variables named after the simulated variables in the workspace, containing the simulated values (with dimensions replic times periods)