Page 1 of 1

IRIS to Dynare: get warnings

PostPosted: Thu Jun 11, 2009 8:51 am
by Chan
Hi,
I previously solved my model without any problem using IRIS. Now, I am trying to do the same using Dynare (please see the attached code) but I got several warnings such "Warning: Log of zero" and "Warning: Divide by zero". Any idea? Thanks in advance.
Chan

DSGEinDynare.mod
(2.96 KiB) Downloaded 186 times

Re: IRIS to Dynare: get warnings

PostPosted: Mon Jun 15, 2009 1:04 pm
by StephaneAdjemian
Hi Chan,

First, square brakets are not allowed in Dynare. So you have to change equations on line 41 and 50.

Second, Dynare uses a Newton algorithm to compute the steady state of the model. By default, the endogenous variables are are initialized at zero. In your case it's a problem because you have ratios of endogenous variables. So you have to change the initialization using the initval block, see the manual here.

Best, Stéphane.

Re: IRIS to Dynare: get warnings

PostPosted: Tue Jun 16, 2009 6:32 am
by Chan
Hi Stéphane,
I replaced the square brackets and inserted the initval block using the guess values, but still got warnings and error messages. So I tried setting the initial values using the steady state values I obtained from running the same model on IRIS but still got warnings and error messages. :|
Thank you so much for the response,
Chan

Re: IRIS to Dynare: get warnings

PostPosted: Tue Jun 16, 2009 8:11 am
by StephaneAdjemian
Hi Chan, Why do you initialize the endogenous variables with complex numbers? This is meaningless. You must initialize the endogenous variables with real variables. If this is the output obtained from IRIS, there must be a bug in this soft which should have warned you that he was unnable to find a (real) steady state. I tried to run the file by removing sqrt(-1) terms, but Dynare complains that he is unnable to find the steady state. Dynare (as IRIS I guess) uses a newton like algorithm to find the steady state. If the initial conditions (declared in the initval block) are too far from the steady state, this algorithm will often fail in finding the steady state.

The best practice is to solve for the steady state analytically and to provide this steady state (as a function of the deep parameters) to Dynare (you will find examples on the forum). If you cannot have the analytical solution, you will have to play with the initial conditions or you may also give a chance to homotopic methods (described here on www.dynare.org/DynareWiki).

Best, Stéphane.

Re: IRIS to Dynare: get warnings

PostPosted: Tue Jun 16, 2009 9:35 am
by Chan
Hi Stéphane,
I will try to do as you suggested. Thank you for responding to my questions so quickly. You have been very helpful!!!
Chan :D

Re: IRIS to Dynare: get warnings

PostPosted: Sat Jul 25, 2009 4:23 pm
by jaromirbenes
Hi Chan & Stephane:

I'm the creator of IRIS, so let me just explain the occurrence of complex numbers in the steady state of models solved by IRIS. IRIS allows the models to have balanced growth paths with any number of unit roots. In that case, the model's steady state is basically a snapshot of the system at an arbitrary time, and each variables must be described by two numbers: its level at that time, and its growth rate (constant over time). To this end, IRIS uses complex numbers, with the real part determining the level and the complex part determining the growth rate -- hence, in fact, it has nothing to do with complex numbers, it's just a convenient way how to carry two pieces of information using just one number.

Cheers,
Jaromir Benes