Does deterministic simulation break down in version 4?

When I do a determistic simulation en version 3 of dynare, the model runs perfectly, but when I want to run the same model with all the same spectications in version 4, the simulation breaks down. However, if I change manually the parser the number 1, the model runs (When I run it normally, the ones in bold don’t appear.

% HISTVAL instructions
oo_.endo_simul( 3, M_.maximum_lag +[size=150]1[/size] -1) = 0.00350370;
oo_.endo_simul( 2, M_.maximum_lag +[size=150]1[/size] -1) = 0.01443718;
oo_.endo_simul( 5, M_.maximum_lag +[size=150]1[/size] -1) = 0.06544927;
oo_.endo_simul( 4, M_.maximum_lag +[size=150]**1 **[/size]-1) = 0.00350370;
oo_.endo_simul( 7, M_.maximum_lag +[size=150]1[/size] -1) = (-0.00718412);
oo_.endo_simul( 1, M_.maximum_lag +[size=150]**1 **[/size]-1) = (-0.01436690);
oo_.endo_simul( 6, M_.maximum_lag +[size=150]1[/size] -1) = (-0.00677433);
oo_.endo_simul( 10, M_.maximum_lag +[size=150]1[/size] -1) = 0;
oo_.endo_simul( 9, M_.maximum_lag +[size=150]1[/size] -1) = 0;
oo_.endo_simul( 11, M_.maximum_lag +[size=150]1[/size] -1) = 0;
oo_.endo_simul( 8, M_.maximum_lag +[size=150]1[/size] -1) = 0;
options_.periods = 50;
options_.simul = 1;

I would appreciate if you could help me with this problem.


The model is attached.
model.mod (2.28 KB)


You are using the wrong timing for variables in the “histval” block. The first period before simulation starts has date 0, not date -1.


I’m suprised that your code works under Dynare v3, because as far as I know the timing convention has not changed between v3 and v4.


Sébastien Villemot, first of all, thank you very much for replying my question.

I would like to make some comments.
As you said about the timing of lags, in versión 4, I change the lags of the variables to time (0) and the model runs perfectly. But, if I use this lag (0) in version 3, the model runs, but the outcomes are incorrect. In version 3, the models runs well only if I use (-1) as the lags of variables. So, I think, there is a differece between version 3 and 4 about the timing for lags.

I send you the model with the two blocks of lagged variables and an excel file which contains the simulation in version 3 and version 4, and the difference between both outputs.

Running the model in both version you could see the difference I have mentioned.

Thanks again for your help.

model_output.xls (133 KB)
model.mod (2.82 KB)


I have run your model (using the right timing convention for histval, i.e. lag 0 and not -1), using both Dynare 4.0.4 and 3.065.

I obtain exactly the same results in both versions. More precisely, I have checked the simulations for variables “y”, “r” and “q”, as in your Excel files these variables differ from v3 to v4.
Actually for these three variables, I get the same paths in both Dynare versions, and those paths correspond the path reported for v4 in your Excel file. So my guess is that the path reported for v3 in your Excel file is wrong: actually it is not what I get with v3 on my computer.