# Simulation after Estimation problem

**URL:** <https://forum.dynare.org/t/simulation-after-estimation-problem/28452>\
**Category:** ML/Bayesian estimation\
**Created:** [21 August 2026 14:51 UTC](https://forum.dynare.org/t/simulation-after-estimation-problem/28452 "2026-08-21T14:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magonfru1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@magonfru1](https://forum.dynare.org/u/magonfru1)\
**Post date:** [21 August 2026 14:51 UTC](https://forum.dynare.org/t/simulation-after-estimation-problem/28452/1 "2026-08-21T14:51:01Z")

</div>

Hi,

I am a fairly advanced user of dynare, and I have built several models, calibrated them, simulated them and estimated them. As I have done several times, I estimated a model, usually SOE-NK, and then run simulations with the estimation. After a succesfull estimation, to get the irfs with the estimated parameters, I change the code in the estimation part to not calculate the mode, not run the mh replication and use the mh results and run and stochastic simulation, as in:

```auto
estimation(datafile='data_XMAS_24Q4_energy_new_ends19q3_newnew.xlsx',

           xls_sheet=DataDemean, xls_range = A1:Ap80,

           mode_compute=0,

% additional_optimizer_steps=[4],

% mh_replic=300000,

% mode_check,

           mode_file=nk_open_elec_LCP_mh_mode,

% load_mh_file,

           mh_nblocks=2,

           mh_drop=0.5,

           plot_priors=0,

           posterior_nograph,

           mh_jscale=0.35);

stoch_simul(irf=40,order=1, hp_filter=1600,nograph);

```

(The nk\_open\_elec\_LCP\_mh\_mode.mat file is copied next to the .mod file). This procedure has worked perfectly. However, in the current model it starts again a mh replication procedure, taking close to two hours instead of the 5-10 minutes it usually takes. I googled this behavior and it states that this is due to an estimation procedure that did not finished properly, but it does not seem to be the problem by looking at the log file. ( I am attaching the log file). What could the reason for this behavior?

[nk\_open\_elec\_LCP.log](https://forum.dynare.org/uploads/short-url/lMz2nfpL2UK1pJU7nkpJUm5kQWi.log) (52.0 KB)

[estimation\_tests4a.inc](https://forum.dynare.org/uploads/short-url/dUwU6em4Nj9utunDwEdFb4Cr3qs.inc) (5.3 KB)

---

<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:** [25 August 2026 06:08 UTC](https://forum.dynare.org/t/simulation-after-estimation-problem/28452/2 "2026-08-25T06:08:53Z")

</div>

Usually, you need to se `mh_replic=0`. Otherwise, `load_mh_file` is for loading the old MCMC and adding to it.

---

<div class="post-metadata">

**Author:** ![magonfru1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@magonfru1](https://forum.dynare.org/u/magonfru1)\
**Post date:** [25 August 2026 17:59 UTC](https://forum.dynare.org/t/simulation-after-estimation-problem/28452/3 "2026-08-25T17:59:26Z")

</div>

I see my error, I have to use mh\_replic=0 instead of just comment it. Otherwise it use the default value of 20000.

Thanks
