Combine impulse response functions


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


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

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’)??

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?


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.

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???

try to load the file filename_results.mat.

Good luck!

Sorry I forgot to precise that oo_ is stored indeed in the mat file “filename_results.mat”.


Ohhhh yeah, now it did work, thanks so much. I’ll try the plotting now!!

Thank you so much for your help.


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?


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)