MJDGGES error code 23 and Euler equation bug

When running deterministic simulations in the mod file posted below I have noticed that I get MJDGGES error code 23 when the Euler equation contains variables raised to the power zero, if the power is a function of model parameters. If I manually replace the parameter names with their numerical values values the code works fine.

An example may clarify what I am trying to say here. If I have (1-l)^(1-phi) where phi = 1, then I get the error code. If I write (1-l)^(1-1) the code works fine.

In the attached mod file lines 98 to 103 contain equivalent Euler equations where some work and some don’t. Comments in the code indicate which give the error code. I am using Dynare 4.1.0, although I think I ran across the same problem a couple of weeks ago with an older Dynare 4.

Thanks for your help.
last_steady8b.pdf (451 Bytes)
RA_forum.mod (11.8 KB)


We are aware of this problem. For more technical background on that issue, see:

Until we fix the problem, I suggest the following workaround:

  • identify the parameters that appear in exponents of something which can equal to zero at some point in the simulation (for example, here “lab” equals 1, so 1-lab=0). Here we have at least parameter “phi”.
  • change the type of these parameters so that they become macro-variables. More precisely, remove them from the “parameters” statement, remove their initialization, and add something like:
@#define phi = 1

See the macro-processor documentation for more details.


Thanks - I’ll look into it.