Fix bug in mex k-order-simulations (i.e. without pruning)
The mex-file dynare_simul_
erroneously iterates on the policy function with a zero shock vector for the first (non-endogenous) period. As a consequence, results differ from the m-file-based simulations at second order and from a one at a time sequential simulation (see https://forum.dynare.org/t/simult-results-different-with-loop/19053/3).
The bug will not affect
- third order simulations with pruning, which are based on the m-file.
- IRFs starting the stochastic steady state/ergodic mean in the absence of shocks due to it being the fixed point of the simulation.
The bug will typically hardly affect moment computations and IRFs at the ergodic mean due to the initial burn-in period. In that case, the initial condition should wash out.
Edited by Johannes Pfeifer