Predicted improvement: NaN

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.

Predicted improvement: NaN

Postby gbel » Wed Jan 27, 2010 5:55 pm

Hello,

In using mode_compute=5 with a problematic model it often happens that we get "Predicted improvement: NaN" then csminit takes forever before the "Try diaogonal Hessian" kicks in.

I have devised this little fix to forgo the csminit computations. It speeds things significantly.

The following two files have been modified from the 4.1.0 version.

In newrat.m, the input badg is set to -1 so csminit knows we're using newrat (so as not to screw up mode_compute=4).

In csminit.m, lines (at 62)
if badg == -1 %Fix NaN
ratto = 1;
badg = 0 ;
else
ratto = 0;
end

are added to put badg back.

then lines (at 114)
if isnan(dfhat) & ratto %Fix NaN
fhat = f0;
retcode = 99;
return
end

are added to return early.

All changes are marked with: %Fix NaN

Hope this helps. Feel free to use that as you like.

Gilles
Attachments
csminit.m
(6.79 KiB) Downloaded 151 times
newrat.m
(8.39 KiB) Downloaded 162 times
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 2 guests