# Can I specify stochastic shocks in forecast

**URL:** <https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443>\
**Category:** Dynare help (legacy posts)\
**Created:** [14 October 2013 15:54 UTC](https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443 "2013-10-14T15:54:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anitazhang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@anitazhang](https://forum.dynare.org/u/anitazhang)\
**Post date:** [14 October 2013 15:54 UTC](https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443/1 "2013-10-14T15:54:23Z")

</div>

Dear all,

I’d like to simulate a transition path with mixing deterministic and stochastic shocks. And according to the Userguide, I complete it using stoch\_simul and forecast. Now I want to feed in the stochastic shocks and examine how different realizations of stochastic shocks can cause a different transition path.

How can I do with Dynare?

What I thought might be related is 1) the approach specified by adamshap - Aug 1, 2006, using simult\_ function. but it is used for models with just stochastic shocks. is there any way to extend it to models with mixed shocks?

1. use the conditional\_forecast command. specifically, I add a trick variable which is set to equal the stochastic policy shock and specify the path of this trick avriable under the conditional\_forecast command. however, the problem is that the transition path produced by Dynare is as if there is no detereministic shock. specifically, when I set the trick variable to be zero for all periods, all endogenous variables become constant at the initial value, despite that I have specified variation in determined shocks in the “shocks” block.

I attached the codes. can any one please take a look and let me know if anything goes wrong. Or it there any other ideas?

Thank you for your time in advance.

Sincerely,  
Anita  
[ramst\_specified\_stoch.mod](https://forum.dynare.org/uploads/default/original/2X/4/4ce7fcdbcc1f767e23120271d186cf46d67fdfe4.mod) (2.12 KB)

---

<div class="post-metadata">

**Author:** ![anitazhang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@anitazhang](https://forum.dynare.org/u/anitazhang)\
**Post date:** [21 October 2013 03:03 UTC](https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443/2 "2013-10-21T03:03:56Z")

</div>

any thoughts?

---

<div class="post-metadata">

**Author:** ![fp3690](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/3bc359/32.png) [@fp3690](https://forum.dynare.org/u/fp3690)\
**Post date:** [6 June 2015 14:02 UTC](https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443/3 "2015-06-06T14:02:24Z")

</div>

I am bumping this because it is an issue I am having (two years later) and I can’t find any good resources other than this post by iacoviel, but as it is dated I am looking for an updated answer.

Thanks!

> [@Contributions of shocks to endogenous variables](https://forum.dynare.org/t/contributions-of-shocks-to-endogenous-variables/287/1):
>
> Dear all, I would like to calculate the contributions of estimated shocks to endogenous variables. I have estimated a DSGE model with Bayesian techniques and have retrieved the shocks (my model has 4 shocks), but now I want to calculate the contribution of each shock to the historical growth of an endogenous variable, eg. output, so that I can say how they explain the historical behaviour of this variable. How can I do that with Dynare? What I thought is that if I include the 4 shocks as exo…

---

<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 June 2015 08:33 UTC](https://forum.dynare.org/t/can-i-specify-stochastic-shocks-in-forecast/3443/4 "2015-06-10T08:33:23Z")

</div>

I don’t understand the actual setup/question. What does a stochastic shock in a forecast mean? Do you want to simulate the uncertainty related to a forecast?

The forecast command allows for combinations of deterministic and stochastic shocks, but it does not allow to set a particular realization of a stochastic shock (which would rather make it deterministic).

If you are dealing with a first-order approximation, you can in principle achieve any combination of deterministic and stochastic shocks by defining the deterministic shocks as perfectly anticipated news shocks and the stochastic shocks as regular shocks and then using the simult\_ function.
