# Simult\_ vs stoch\_simul

**URL:** <https://forum.dynare.org/t/simult--vs-stoch-simul/5535>\
**Category:** Dynare help (legacy posts)\
**Created:** [24 May 2016 16:41 UTC](https://forum.dynare.org/t/simult--vs-stoch-simul/5535 "2016-05-24T16:41:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidus87](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@sidus87](https://forum.dynare.org/u/sidus87)\
**Post date:** [24 May 2016 16:41 UTC](https://forum.dynare.org/t/simult--vs-stoch-simul/5535/1 "2016-05-24T16:41:37Z")

</div>

Dear All,

I have a question concerning the simulation of the model using simult\_ and stoch\_simul.  
In particular, i wanna calculate the ergodic mean of a variable “y”. For this I consider two possibilities:

rng(1000)  
stoch\_simul(order=3,periods=10000,drop=8000,replic=0,irf=0,noprint,nomoments,nofunctions,nocorr,pruning);

and then just take mean(y).

Alternatively what I do is:

T=10000;  
ex\_ = randn(T,2); %I have two shocks in the model. shocks in the model are written as sigma\_eps\*eps  
rng(1000)  
simulation=simult\_(oo\_.steady\_state,oo\_.dr,ex\_,options\_.order);  
ergo=mean(simulation(:,8000:end));  
endonames=cellstr(M\_.endo\_names); %make them strings to use strcmp  
index=find(strcmp(‘y’,endonames));  
y\_ergo=mean(ergo(index));

strangely the results are very different. With the first procedure I get 0.9122 and with the second I get -7.8219.

Do you have an explanation for this?

---

<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:** [28 May 2016 08:21 UTC](https://forum.dynare.org/t/simult--vs-stoch-simul/5535/2 "2016-05-28T08:21:54Z")

</div>

Did you enable pruning for the second one? If yes, please provide the codes
