Page 1 of 1

MJDGGES error code 23 and Euler equation bug

PostPosted: Wed Jan 13, 2010 11:27 am
by adam_elbourne
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.

Re: MJDGGES error code 23 and Euler equation bug

PostPosted: Wed Jan 13, 2010 12:21 pm
by SébastienVillemot
Hi,

We are aware of this problem. For more technical background on that issue, see:
https://www.dynare.org/trac/ticket/78

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:
Code: Select all
@#define phi = 1


See the macro-processor documentation for more details.

Best

Re: MJDGGES error code 23 and Euler equation bug

PostPosted: Wed Jan 13, 2010 12:37 pm
by adam_elbourne
Thanks - I'll look into it.