# Bayesian IRF Graphs

**URL:** <https://forum.dynare.org/t/bayesian-irf-graphs/3147>\
**Category:** ML/Bayesian estimation\
**Created:** [10 May 2013 13:51 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147 "2013-05-10T13:51:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![scholar\_26](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@scholar\_26](https://forum.dynare.org/u/scholar_26)\
**Post date:** [10 May 2013 13:51 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/1 "2013-05-10T13:51:40Z")

</div>

Could you please explain how to interpret bayesian graphs?  
And why dont they turn zero after a specific period? (like attached results)  
[Bayesian\_IRF.pdf](https://forum.dynare.org/uploads/default/original/2X/e/e48d74a1d807a95ddd24430472f2e6b7809c5b2e.pdf) (12.2 KB)

---

<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:** [10 May 2013 14:40 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/2 "2013-05-10T14:40:55Z")

</div>

From a soon to be published internal documentation:

Orthogonalized shock to shock\_x:

Bayesian IRF plot generated by the bayesian\_irf-option of the estimation-command. It is stored in the Output-subfolder. Generally, these IRFs are similar to the ones displayed with stoch\_simul and use the same orthogonalization scheme. The main difference is that the stoch\_simul-IRFs are computed at the calibrated parameter combination, while the Bayesian IRFs are the mean impulse responses (not to be confused with the IRFs at the mean). The gray shaded areas provide highest posterior density intervals (Highest Posterior Density Interval (HPDI)). If you want to compute classical IRFs after estimation, use stoch\_simul after estimation as the latter will set the parameters to the posterior mode/mean, depending on whether you use maximum likelihood or Bayesian estimation. More information can be found in Adjemian, Bastani, Juillard, Karamé, Mihoubi, Perendia, Pfeifer, Ratto, and Villemot (2011)

Note that in your case the IFRs will go back to 0 if you increase the time horizon.

---

<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:** [29 August 2014 14:45 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/3 "2014-08-29T14:45:04Z")

</div>

Update: The documentation is now available as Pfeifer (2014): An Introduction to Graphs in Dynare at [sites.google.com/site/pfeiferecon/dynare](https://sites.google.com/site/pfeiferecon/dynare)

---

<div class="post-metadata">

**Author:** ![Daniel\_Bendel](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@Daniel\_Bendel](https://forum.dynare.org/u/Daniel_Bendel)\
**Post date:** [29 August 2014 16:07 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/4 "2014-08-29T16:07:43Z")

</div>

Thanks man! This is a really helpful documentation!!

---

<div class="post-metadata">

**Author:** ![Tojonirina](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@Tojonirina](https://forum.dynare.org/u/Tojonirina)\
**Post date:** [1 January 2019 13:15 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/5 "2019-01-01T13:15:19Z")

</div>

do these graph show the explosivness?  
If so, what should I do?  
[dsge\_mada\_debt1\_Bayesian\_IRF\_etaa\_1.fig](https://forum.dynare.org/uploads/default/original/2X/0/01ae8cdb56f950972fba092dada9df232dbf2fe8.fig) (163.7 KB)

---

<div class="post-metadata">

**Author:** ![Tojonirina](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@Tojonirina](https://forum.dynare.org/u/Tojonirina)\
**Post date:** [1 January 2019 13:33 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/6 "2019-01-01T13:33:49Z")

</div>

If I want to run a stoch simul by replacing all parameters value by those generated by the estimated (bayesian estimation)…How should I proceed? I do not want to pick each parameter value one by one, It will waste my time.  
I mean to use code like \<load… \> and to it automatically

Thanks in advance

---

<div class="post-metadata">

**Author:** ![punnoosejacob](https://forum.dynare.org/user_avatar/forum.dynare.org/punnoosejacob/32/5976_2.png) [@punnoosejacob](https://forum.dynare.org/u/punnoosejacob)\
**Post date:** [1 January 2019 19:47 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/7 "2019-01-01T19:47:18Z")

</div>

(1) With posterior mode  
1a. If you aleady have a filename\_mode file available, you first load the mode file using the estimation(datafile=…, mode\_file=filename\_mode, mh\_replics=0) option and then do a stoch\_simul right after the estimation command.  
1b. If you dont have a mode file available, just do the estimation without implementing MCMC, and then do the stoch\_simul

(2) With posterior mean  
Do stoch\_simul after the estimation command which implements MCMC (mh\_replics\>0)

Cheers  
Reuben

---

<div class="post-metadata">

**Author:** ![Tojonirina](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@Tojonirina](https://forum.dynare.org/u/Tojonirina)\
**Post date:** [2 January 2019 04:18 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/8 "2019-01-02T04:18:57Z")

</div>

yes, I already have the mode file so I do not want to run again the MCMC procedure (so time consuming). I just need the bayesian IRF for the stoch simul…If I understand \<mh\_replic=0\> in estimation command do it .

Now, I need your aid in order to treat the explosiveness of my model variable. What tips should you suggest in such case?  
attached below is the dynare mode file  
[dsge\_mada\_debt1.mod](https://forum.dynare.org/uploads/default/original/2X/0/0d56a942821d2308349d3c05c7b4d85a4a8b29fa.mod) (30.1 KB)

Thank you @punnoosejacob

---

<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:** [2 January 2019 07:43 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/9 "2019-01-02T07:43:40Z")

</div>

1. Do you want to generate IRFs using `stoch_simul` from an already estimated model? Or do you want to generate `bayesian_irfs`?
2. The oscillating IRFs in your mod-file usually indicate a fundamental timing error.

---

<div class="post-metadata">

**Author:** ![Tojonirina](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@Tojonirina](https://forum.dynare.org/u/Tojonirina)\
**Post date:** [2 January 2019 11:24 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/10 "2019-01-02T11:24:30Z")

</div>

1 - I want to use stoch simul from an already estimated model  
2 - what do you mean by timing error, is it from the ARMA equation ? or which one?  
can you give me a hint to deal with it? How shoul I harmonize it properly?

Best regards prof @jpfeifer

---

<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:** [7 January 2019 11:43 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/11 "2019-01-07T11:43:16Z")

</div>

1. In this case, you can simply use `load_mh_file` together with `mh_replic=0` in the estimation command, followed by `stoch_simul`
2. The oscillating IRFs indicate that somewhere in your model there must be a timing error, e.g. related to the timing of a predetermined state variable. It’s pretty clear that

```auto
k(+1)= (1-tau)*k+tau*I; 

```

does not conform to Dynare’s timing convention.

---

<div class="post-metadata">

**Author:** ![anemone](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@anemone](https://forum.dynare.org/u/anemone)\
**Post date:** [14 March 2022 06:55 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/12 "2022-03-14T06:55:59Z")

</div>

> [@jpfeifer](#):
>
> Do you want to generate IRFs using `stoch_simul` from an already estimated model? Or do you want to generate `bayesian_irfs`?

How could I generate Bayesian IRFs from an already estimated model?  
It seems that, even if I have a posterior estimation result without `bayesian_irfs`, I have to rerun the entire estimation including the MCMC process to obtain Bayesian IRFs.

---

<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:** [14 March 2022 12:44 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/13 "2022-03-14T12:44:29Z")

</div>

You could simply run the `estimation`- command with 0 replications the `load_mh_file`-option.

---

<div class="post-metadata">

**Author:** ![anemone](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@anemone](https://forum.dynare.org/u/anemone)\
**Post date:** [15 March 2022 01:35 UTC](https://forum.dynare.org/t/bayesian-irf-graphs/3147/14 "2022-03-15T01:35:01Z")

</div>

It successfully worked. I always appreciate all your help and insights including other posts.  
Thank you very much.
