NaN or Inf asserted, Dynare 4.43

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.

NaN or Inf asserted, Dynare 4.43

Postby eastnile » Thu Jul 09, 2015 11:51 pm

Dear Community,

Like some others on the forum, I have been running across this error, and I am having trouble diagnosing it:
Code: Select all
dynare:k_order_perturbation: Caught Kord exception: NaN or Inf asserted in first order derivatives in FirstOrder::solve


I've searched through the previous posts on this issue, but none appear to apply directly. So far, I know the following:
1. The error only occurs in the 3rd order approximation, not the 1st or 2nd. However, I need the 3rd order approximation as my model involves risk.

2. The error doesn't occur for all parameter values. For my key parameter, sigf, the error appears when sigf is smaller than -4.0 or greater than roughly 1.0.

3. The error seems to be confined to the Jacobian matrix, as the error message suggests. If stop the code mid-execution and replace the g_1 matrix with the g_1 matrix from a previous non-error generating parameter set, the error goes away. (Specifically, I do this during line 64 of k_order_pert.m, which calls the MEX files that evaluate the _dynamic.m file)

4. Using the same technique as above, I've narrowed down the issue to the 3rd row of the Jacobian, which corresponds to my capital supply equation (this equation is rather long). However, none of the values here are ever NaN or Inf, as suggested by the error message. Further, the error persists even when sigf is set slightly greater than one (say, 1.2), at which point the g1 matrix takes on only reasonably sized values.

I am attaching my .mod file, as well as the steady state file (and two associated files) needed to compute the steady state. Any assistance would be greatly appreciated.

Zhaochen He
Attachments
ss_solver2.m
(1.73 KiB) Downloaded 67 times
ss_solver1.m
(1.58 KiB) Downloaded 58 times
paper_0_1_steadystate.m
(2.11 KiB) Downloaded 63 times
paper_0_1.mod
(2.06 KiB) Downloaded 62 times
eastnile
 
Posts: 8
Joined: Thu May 22, 2014 3:30 am
Location: Oregon, USA

Re: NaN or Inf asserted, Dynare 4.43

Postby jpfeifer » Sat Jul 11, 2015 8:28 am

When you put
Code: Select all
check;

into your file, you will see that for this parameter draw, the BK condition is not satisfied. This is the error message you get in case of using the third order dll-files.
------------
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: Google [Bot] and 7 guests