Some element of Newton direction isn't finite

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Some element of Newton direction isn't finite

Postby Danielima » Mon Aug 24, 2015 1:46 am

Hi,

When I try to run the attached code in Dynare I get the following message: "??? Error using ==> lnsrch1 at 71
Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values". Can anybody help me with that, please?

Also, on a related note, suppose that my model has an infinity of steady states (I guess this is the case). If I provide a possible steady state, can Dynare compute the IRFs from there, or it has to be a unique steady state? (given the steady state I guess the path following a shock is unique)

Thanks!
Attachments
twoSAV.mod
(4.93 KiB) Downloaded 85 times
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby jpfeifer » Mon Aug 24, 2015 9:55 am

Use the current unstable version (to be released as Dynare 4.5) with
Code: Select all
resid(1);
steady(maxit=1000);
check;

and you will find a steady state.

Dynare accepts any steady state that you provide. It does not have to be unique.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Some element of Newton direction isn't finite

Postby Danielima » Mon Aug 24, 2015 2:03 pm

It worked, thank you very much for the help!
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby Danielima » Mon Aug 24, 2015 2:34 pm

So, I have a different version of the previous code with a minor change: the variable "phi" is defined as in the equation in line 166, instead of the one in line 164. The steady state value of "phi" should remain the same, which is zero.

However, when I try to run this code I get the message: “Impossible to find the steady state. Either the model doesn't have a steady state, there are an infinity of steady states, or the guess values are too far from the solution”, even with the unstable version. Do you know what might be the problem?

Thanks again.

(attached is the version with the minor change from the previous one)
Attachments
twoSAVk100.mod
(4.95 KiB) Downloaded 82 times
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby jpfeifer » Sun Aug 30, 2015 11:09 am

With phi=0, you have in steady state
Rk = 0.012746323992582
R = 0.010050326355400

so that
Rk-R=0.002695997637182

But your
RkmR_ss = 0.002696100000000

which is different so that it does not add up.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Some element of Newton direction isn't finite

Postby Danielima » Tue Sep 01, 2015 12:38 pm

Did it work for you? I don't think this is the problem. I changed the value for RkmR_ss to the value you provided, and it still doesn't work, even though the value that Dynare calculates for "psi" in the steady-state is zero when it crashes. I get the same message: "Impossible to find the steady state. Either ..."

I checked the values provided by "resid(1)" and I guess the problem is with the variables CK, CW, BK and BW. The thing is, I do have a infinity of steady states in this model. "C" and "B" can be divided in any way between CK and CW, and BK and BW, respectively (C = sigma*CK + (1-sigma)*CW, and B = sigma*BK + (1-sigma)*BW). But I provide values for this variables because I have a specific steady-state in mind.

Do you have a clue on what the problem might be?

Thanks again for the reply.

P.S.: I wrote before that I changed the definition for "phi", what I meant was "psi" (psi = kappa*(Rk(+1)-R-RkmR_ss)), sorry. Attached is the code with the values you provided for Rk, R and RkmR_ss.
Attachments
twoSAVk100.mod
(5.02 KiB) Downloaded 83 times
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby jpfeifer » Tue Sep 01, 2015 12:50 pm

My point is that when you have infinitely many steady states, you need to provide Dynare with a correct steady state. You do not do this with your added equation. As I outlined in my previous post, there is a small difference in values that throws Dynare off. When you tweak one parameter (RkmR_ss in the last file) it might happen that other equations do not match.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Some element of Newton direction isn't finite

Postby Danielima » Tue Sep 01, 2015 12:55 pm

I didn't know that such small differences would be problematic. Thanks again, all revise my values and be more precise!
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby jpfeifer » Tue Sep 01, 2015 2:04 pm

Dynare's default tolerance is 10e-6 if I remember correctly. Anything above that is not a steady state.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Some element of Newton direction isn't finite

Postby Danielima » Tue Sep 01, 2015 2:10 pm

Wow! When Dynare said "guess values too far from the solution" I thought it would mean, in the worst case, something like 10e-3...
Danielima
 
Posts: 6
Joined: Wed Apr 01, 2015 2:03 am

Re: Some element of Newton direction isn't finite

Postby jpfeifer » Tue Sep 01, 2015 2:53 pm

When there is a unique solution, the derivatives will provide information on how to find the steady state. In your case with a multiplicity of steady states, the derivatives in some direction will be 0. Even small differences can provide insurmountable obstacles for Newton-type solvers.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 2 guests

cron