Skip to content
Snippets Groups Projects
Verified Commit 97e23ff8 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

evaluate_planner_objective.m: add warning if NaN are encountered

(cherry picked from commit 048e059b)
parent c218be23
Branches
Tags
No related merge requests found
Pipeline #6182 failed
......@@ -168,6 +168,13 @@ if options_.ramsey_policy
options_.noprint = 0;
end
if any(isnan(oo_.mean)) || any(isnan(oo_.mean))
fprintf('evaluate_planner_objective: encountered NaN moments in the endogenous variables often associated\n')
fprintf('evaluate_planner_objective: with either non-stationary variables or singularity due e.g. including\n')
fprintf('evaluate_planner_objective: the planner objective function (or additive parts of it) in the model.\n')
fprintf('evaluate_planner_objective: I will replace the NaN with a large number, but tread carefully,\n')
fprintf('evaluate_planner_objective: check your model, and watch out for strange results.\n')
end
oo_.mean(isnan(oo_.mean)) = options_.huge_number;
oo_.var(isnan(oo_.var)) = options_.huge_number;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment