Page 1 of 1

Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 3:52 am
by thanhha9289
Dear Prof. Jpfeifer and Dynare User
My name is Le Thanh Ha.
I am working in the research relating trending inflation, from Ascari paper (2014). I develope the paper from Ireland and use the same idea about the trending inflation as Ascari at el (2014).
I wrote the Dynare code to simulate the nonlinear system, but an error came out as below
Code: Select all
"Reference to non-existent field 'exo_nbr'.

Error in nonlinear_Calvos1 (line 332)
if M_.exo_nbr > 0;

Error in dynare (line 180)
evalin('base',fname) ;"


I do not what is it and how to fix it. So many time I attempt to fix this mistake but It do not run.
I attached my Dynare code.
Any help is greatly appreciated.
Thank you so much

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 8:15 am
by jpfeifer
Never put
Code: Select all
clear all
in a mod-file!!!!!!!!!!!!!!!!!!

Note also that the way the loop is conducted is not advocated. The the correct way see e.g.
https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Ascari_Sbordone_2014/Ascari_Sbordone_2014.mod

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 8:45 am
by thanhha9289
Dear Professor
In the first time, I also want to replicate as your way, but as you indicated that there is a problem relating to the Dynare 4.4.3 that we should employ a higher version.
However, i do now find any other version better than 4.4.3.
Please show me how to run your code
Thank Professor so much

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 8:53 am
by thanhha9289
jpfeifer wrote:Never put
Code: Select all
clear all
in a mod-file!!!!!!!!!!!!!!!!!!

Note also that the way the loop is conducted is not advocated. The the correct way see e.g.
https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Ascari_Sbordone_2014/Ascari_Sbordone_2014.mod

Dear Professor
In the first time, I also want to replicate as your way, but as you indicated that there is a problem relating to the Dynare 4.4.3 that we should employ a higher version.
However, i do now find any other version better than 4.4.3.
Please show me how to run your code

Actually, this code I showed you here following Ascari's code (paper in 2014) but my model is completely different from this paper.
Please tell me which way I should follow to simulate this.
Thank Professor so much

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 8:59 am
by jpfeifer
If you want to loop, http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891
Regarding the unstable version, you can find it here: http://www.dynare.org/download/dynare-unstable

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 9:06 am
by thanhha9289
Anyway, firtly I want to fix the problem relating to code designed by Ascari before jumping into your code.
I run this code without "clear all", the error is below

Code: Select all
STEADY:  The Jacobian contains Inf or NaN. The problem arises from:

STEADY:  Derivative of Equation 2 with respect to Variable lambda  (initial value of lambda: 0)
STEADY:  Derivative of Equation 2 with respect to Variable n  (initial value of n: 1.04264)

STEADY:  The problem most often occurs, because a variable with
STEADY:  exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY:  and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN


Please tell me how to fix this code? What I shoud adjust to make solve this problem. Eventhough, I try to modify the parameters but the same problem still came out.
Thank Professor so much
Ha

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Fri Mar 18, 2016 9:31 am
by thanhha9289
jpfeifer wrote:If you want to loop, http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891
Regarding the unstable version, you can find it here: http://www.dynare.org/download/dynare-unstable

Anyway, firtly I want to fix the problem relating to code designed by Ascari before jumping into your code.
I run this code without "clear all", the error is below

CODE: SELECT ALL
STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 2 with respect to Variable lambda (initial value of lambda: 0)
STEADY: Derivative of Equation 2 with respect to Variable n (initial value of n: 1.04264)

STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN



Please tell me how to fix this code? What I shoud adjust to make solve this problem. Eventhough, I try to modify the parameters but the same problem still came out.
Thank Professor so much
Ha

Re: Error "Reference to non-existent field 'exo_nbr"

PostPosted: Sat Mar 19, 2016 1:00 pm
by jpfeifer
Please provide the most recent version of the mod-file.