From 6990d302e0efe332d75a1f54c3001bc9fd1531a2 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 17 May 2022 18:10:56 +0200
Subject: [PATCH] evaluate_planner_objective.m: add warning if planner discount
 is not smaller than 1

(cherry picked from commit 26db005e614e424f54fe72bd2868875a9beb9779)
---
 matlab/evaluate_planner_objective.m | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/matlab/evaluate_planner_objective.m b/matlab/evaluate_planner_objective.m
index d306fe0723..7b816a07d2 100644
--- a/matlab/evaluate_planner_objective.m
+++ b/matlab/evaluate_planner_objective.m
@@ -86,6 +86,10 @@ nstatic = M_.nstatic;
 nspred = M_.nspred;
 beta = get_optimal_policy_discount_factor(M_.params, M_.param_names);
 
+if beta>=1
+    fprintf('evaluate_planner_objective: the planner discount factor is not strictly smaller than 1. Unconditional welfare will not be finite.\n')
+end
+
 if options_.ramsey_policy
     if oo_.gui.ran_perfect_foresight
         T = size(oo_.endo_simul,2);
-- 
GitLab