# Drawing from non-normal distributions in model simulation

**URL:** <https://forum.dynare.org/t/drawing-from-non-normal-distributions-in-model-simulation/802>\
**Category:** Stochastic simulations\
**Created:** [6 September 2008 15:52 UTC](https://forum.dynare.org/t/drawing-from-non-normal-distributions-in-model-simulation/802 "2008-09-06T15:52:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwayder](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@shwayder](https://forum.dynare.org/u/shwayder)\
**Post date:** [6 September 2008 15:52 UTC](https://forum.dynare.org/t/drawing-from-non-normal-distributions-in-model-simulation/802/1 "2008-09-06T15:52:30Z")

</div>

Hi There,

I was trying to simulate (not estimate) a model and I want my shocks to not have normal distributions. Particularly I’d be interested in specifying that my shocks are uniformly distributed. (I’m also interested in truncated normals, but given a uniform random variable I can turn it into a truncated normal.)

I poked around the manual and the forum here but couldn’t seem to figure out the best way to specify how to do this in the shocks; statement.

Thanks for the help,  
AS

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [7 September 2008 12:23 UTC](https://forum.dynare.org/t/drawing-from-non-normal-distributions-in-model-simulation/802/2 "2008-09-07T12:23:24Z")

</div>

Hi, There is no way in Dynare to simulate a stochastic model with non gaussian structural shocks. If you want to simulate a model with, say, uniform distributions for the structural shocks you have to change the matlab file simult.m (in the matlab directory). You just have to replace line 64:

```auto
oo_.exo_simul(:,i_exo_var) = randn(M_.maximum_lag+M_.maximum_lead+options_.periods,nxs)*chol_S;
```

by something like

```auto
oo_.exo_simul(:,i_exo_var) = rand(M_.maximum_lag+M_.maximum_lead+options_.periods,nxs);
```

for uniform distributions between 0 and 1.

Best,  
Stéphane.
