Commit 8cb99bfe authored by Johannes Pfeifer 's avatar Johannes Pfeifer
Browse files

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

Prevents false error message
parent 5c75c301
...@@ -67,6 +67,9 @@ if options_.steadystate_flag ...@@ -67,6 +67,9 @@ if options_.steadystate_flag
options_,0); options_,0);
end end
[U,Uy,W] = feval([M_.fname,'.objective.static'],zeros(endo_nbr,1),[], M_.params); [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)) if any(any(Uy~=0))
non_zero_derivs=find(any(Uy~=0)); non_zero_derivs=find(any(Uy~=0));
for ii=1:length(non_zero_derivs) for ii=1:length(non_zero_derivs)
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