# Monte Carlo Estimation Exercise

**URL:** <https://forum.dynare.org/t/monte-carlo-estimation-exercise/11338>\
**Category:** Stochastic simulations\
**Created:** [6 February 2018 21:56 UTC](https://forum.dynare.org/t/monte-carlo-estimation-exercise/11338 "2018-02-06T21:56:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![konstantinos](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/ce7236/32.png) [@konstantinos](https://forum.dynare.org/u/konstantinos)\
**Post date:** [6 February 2018 21:56 UTC](https://forum.dynare.org/t/monte-carlo-estimation-exercise/11338/1 "2018-02-06T21:56:04Z")

</div>

Dear All,  
I trust you are well. I am trying to conduct a Monte-Carlo simulation exercise. The exercise is quite simple, generate a number of T x N data pseudo sets and estimate the model for each pseudo set. I thought that I would be able to do that by:

1. replacing the dataset\_.data with the simulated data (it turns out that the creation of a new dataset\_ object is much easier than just replacing the data)
2. using dynare\_estimation\_1(options\_.varobs,’’) each time  
Unfortunately, it does work, dynare\_estimation\_1 seems to use always the same data set. I tried:
3. clear dataset\_
4. clear -global dataset\_
5. clear(‘global’,‘dataset\_’)  
Any suggestions would be extremely appreciated.  
Kostas

---

<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 February 2018 08:45 UTC](https://forum.dynare.org/t/monte-carlo-estimation-exercise/11338/2 "2018-02-07T08:45:27Z")

</div>

My guess is you provided a datafile to the estimation command so that the datafile is read out in every iteration. Try the approach at [tests/dates/fs2000.mod · master · Dynare / dynare · GitLab](https://git.dynare.org/Dynare/dynare/-/blob/master/tests/dates/fs2000.mod)

---

<div class="post-metadata">

**Author:** ![konstantinos](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/ce7236/32.png) [@konstantinos](https://forum.dynare.org/u/konstantinos)\
**Post date:** [7 February 2018 15:39 UTC](https://forum.dynare.org/t/monte-carlo-estimation-exercise/11338/3 "2018-02-07T15:39:34Z")

</div>

Dear Johannes,  
Many many many thanks for your prompt reply. You are spot on!  
Many thanks again.  
Kostas
