# Simulate a model using smoothed shocks

**URL:** <https://forum.dynare.org/t/simulate-a-model-using-smoothed-shocks/3008>\
**Category:** Dynare help (legacy posts)\
**Created:** [11 March 2013 13:35 UTC](https://forum.dynare.org/t/simulate-a-model-using-smoothed-shocks/3008 "2013-03-11T13:35:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Lara](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@Lara](https://forum.dynare.org/u/Lara)\
**Post date:** [11 March 2013 13:35 UTC](https://forum.dynare.org/t/simulate-a-model-using-smoothed-shocks/3008/1 "2013-03-11T13:35:09Z")

</div>

Dear Dynare experts,

I really cannot solve a problem: I would like to simulate a model using the series of exogenous shocks obtained from Bayesian estimation.  
How to do it?

In which part of the dynare code should I write the mat file of the smoothed shocks? Should it be in the shocks block? If so, how exactly?  
Should it be in the stoch\_simul command? If so, how?  
Should I write additional lines in the dynare code?

Would it be possible for you to add an example in order to solve this issue?  
Other users had the same problem, but answers are not satisfactory. In particular;

1. I tried with the example posted by Michel Juillard (example5.mod) on Aug 10,2006 but it does not work ([Static Simulation](https://forum.dynare.org/t/static-simulation/154/1)). I get the following error message .?? Undefined function or variable 'dr\_'  
2)Since the command “shocks(shocks\_file=filename)” does not work ([Shocks\_file not working](https://forum.dynare.org/t/shocks-file-not-working/2900/1)) I tried with “shocks(initval\_file=filename)” but it does not work either. I get the following error message: syntax error, unexpected ‘(’, expecting ‘;’. The filename is a .mat file which contains the smoothed series of the shocks.

Your help is greatly appreciated.

Thanks,  
Lara

---

_[View the full topic](https://forum.dynare.org/t/simulate-a-model-using-smoothed-shocks/3008)._
