# Combine impulse response functions

**URL:** https://forum.dynare.org/t/combine-impulse-response-functions/1268
**Category:** Dynare help (legacy posts)
**Created:** [8 December 2009 21:21 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268 "2009-12-08T21:21:10Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Tartaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@Tartaglia](https://forum.dynare.org/u/Tartaglia)
#### Post date: [8 December 2009 21:21 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/1 "2009-12-08T21:21:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![AssiaEzzeroug](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@AssiaEzzeroug](https://forum.dynare.org/u/AssiaEzzeroug)
#### Post date: [9 December 2009 10:26 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/2 "2009-12-09T10:26:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tartaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@Tartaglia](https://forum.dynare.org/u/Tartaglia)
#### Post date: [9 December 2009 19:12 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/3 "2009-12-09T19:12:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tartaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@Tartaglia](https://forum.dynare.org/u/Tartaglia)
#### Post date: [9 December 2009 23:22 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/4 "2009-12-09T23:22:46Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![AssiaEzzeroug](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@AssiaEzzeroug](https://forum.dynare.org/u/AssiaEzzeroug)
#### Post date: [10 December 2009 10:01 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/5 "2009-12-10T10:01:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Tartaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@Tartaglia](https://forum.dynare.org/u/Tartaglia)
#### Post date: [10 December 2009 10:19 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/6 "2009-12-10T10:19:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pakocica](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@pakocica](https://forum.dynare.org/u/pakocica)
#### Post date: [10 December 2009 11:34 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/7 "2009-12-10T11:34:52Z")

</div>

Tartaglia,  
try to load the file filename\_results.mat.

Good luck!  
Pavel

---

<div class="post-metadata">

### Author: ![AssiaEzzeroug](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@AssiaEzzeroug](https://forum.dynare.org/u/AssiaEzzeroug)
#### Post date: [10 December 2009 11:47 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/8 "2009-12-10T11:47:54Z")

</div>

Sorry I forgot to precise that oo\_ is stored indeed in the mat file “filename\_results.mat”.

Best

---

<div class="post-metadata">

### Author: ![Tartaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/a88e4f/32.png) [@Tartaglia](https://forum.dynare.org/u/Tartaglia)
#### Post date: [10 December 2009 14:13 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/9 "2009-12-10T14:13:40Z")

</div>

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

Thank you so much for your help.

Tartaglia

---

<div class="post-metadata">

### Author: ![ericlearndynare](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/c4cdca/32.png) [@ericlearndynare](https://forum.dynare.org/u/ericlearndynare)
#### Post date: [22 June 2012 13:43 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/10 "2012-06-22T13:43:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [22 June 2012 15:16 UTC](https://forum.dynare.org/t/combine-impulse-response-functions/1268/11 "2012-06-22T15:16:28Z")

</div>

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)
