From d0924f08b70d2791e8bf1d8d12e66612b4706110 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 11 Feb 2020 18:14:05 +0100
Subject: [PATCH] Discretionary policy: remove useless call to steady state
 file

The steady state is always zero for discretionary policy. And, in the case of a
steady state file, this call would not be able to update parameters (since it
does not modify M_), nor would it need to do so (since this has already be done
earlier in the function).

Ref. #1705

(cherry picked from commit 181725c77850a24bcf5e0f99434915fda4db0db5)
---
 matlab/discretionary_policy_1.m | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/matlab/discretionary_policy_1.m b/matlab/discretionary_policy_1.m
index 1ba64e39fe..df38ce4c7e 100644
--- a/matlab/discretionary_policy_1.m
+++ b/matlab/discretionary_policy_1.m
@@ -74,7 +74,7 @@ end
 if options_.steadystate_flag
     % explicit steady state file
     [~,M_.params,info] = evaluate_steady_state_file(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_, ...
-                                                    options_,0);
+                                                    options_,false);
 end
 [U,Uy,W] = feval([M_.fname,'.objective.static'],zeros(endo_nbr,1),[], M_.params);
 if any(any(isnan(Uy)))
@@ -178,12 +178,4 @@ dr.ghu=G(order_var,:);
 Selection=lead_lag_incidence(1,order_var)>0;%select state variables
 dr.ghx=T(:,Selection);
 
-dr.ys=NondistortionarySteadyState(M_);
 oo_.dr = dr;
-
-function ys=NondistortionarySteadyState(M_)
-if exist([M_.fname,'_steadystate.m'],'file')
-    eval(['ys=',M_.fname,'_steadystate.m;'])
-else
-    ys=zeros(M_.endo_nbr,1);
-end
-- 
GitLab