Simulating more periods than specified

I specify the following commands for the simulation of my model

stoch_simul(periods=1000, order=1, simul_seed=100, irf = 0);

However, Dynare simulates 1003 periods of the endogenous variables and 1002 periods of the exogenous variables. Why is this and how does the timing of the shocks and endogenous variables line up?

Thanks for your help with this simple question.

Hi,

Your model probably contains one lag (on endogenous variables), so there must be one period of initial conditions before the simulation starts.

So the first date of the exogenous vector is date 1, and the first date of the endogenous vector is date 0.

So there are truly 1002 periods of simulation, and 1 period of initial conditions.

The fact that there are 2 extra simulation periods is a small bug of Dynare, but without real consequences since you can just truncate the simulations.

Best