Verified Commit 9a4de2c8 authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

discretionary_policy_1.m: check for NaN before checking for non-zero derivatives

Prevents false error message

(manually cherry picked from commit 8cb99bfe)
parent eddf501b
......@@ -67,6 +67,9 @@ if options_.steadystate_flag
[U,Uy,W] = feval([M_.fname,'_objective_static'],zeros(endo_nbr,1),[], M_.params);
if any(any(isnan(Uy)))
error(['discretionary_policy: the derivatives of the objective function contain NaN'])
if any(any(Uy~=0))
error(['discretionary_policy: the objective function must have zero ' ...
'first order derivatives'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment