Multiple period OLG - problem with sim1

Dear all,

I have a question concerning the simulation of deterministic shocks in a standard three or more period OLG model in Dynare.

In (for instance) a three period OLG model, with standard settings, it was always possible for me to simulate shocks using older versions of Dynare (eg. 4.2.5 or older).

However, using versions 4.3… and especially the unstable 4.4 I always get an error as mentioned below. It seems that in reshaping the simulation elements, there is some error in line 153 of sim1. I can solve this by changing “periods+2” to “periods+2*(n-1)” where n = the number of periods in the model.
I have both a four-period and a thirty-period OLG model in Dynare. And indeed, for the four-period model to simulate correctly, I need to change this line to periods+23, for the thirty-period model, I need to change this to periods+229. In our model, there are indeed multiple lags and leads (n-1 to be concrete).

I was wondering if this is a common problem, or if anything else can be done in the .mod file to solve this.

Thanks in advance.

Tim Buyse
Ghent University

Error using reshape
To RESHAPE the number of elements must not change.
Error in sim1 (line 153)
oo_.endo_simul = reshape(Y,ny,periods+2);

Error in simul (line 121)
Error in retp1 (line 589)
Error in dynare (line 147)
evalin(‘base’,fname) ;

Please send me the mod-file to investigate the issue.

This seems to be a bug. We are investigating the issue and will keep you updated.

The issue has been fixed in Dynare 4.4.1