From 1b4fb46c75476340aec67fa02ae4b46af544c8aa Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 12 Dec 2023 18:30:30 +0100
Subject: [PATCH] Consistently use nocheck flag for steady state

Fixes a bug in model_diagnostics.m
---
 matlab/discretionary_policy/discretionary_policy_1.m     | 2 +-
 matlab/model_diagnostics.m                               | 2 +-
 tests/prior_posterior_function/posterior_function_demo.m | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/matlab/discretionary_policy/discretionary_policy_1.m b/matlab/discretionary_policy/discretionary_policy_1.m
index 18d96c7175..f8c60afadc 100644
--- a/matlab/discretionary_policy/discretionary_policy_1.m
+++ b/matlab/discretionary_policy/discretionary_policy_1.m
@@ -40,7 +40,7 @@ beta = get_optimal_policy_discount_factor(M_.params, M_.param_names);
 if options_.steadystate_flag
     % explicit steady state file
     [ys,M_.params,info] = evaluate_steady_state_file(endo_steady_state,[exo_steady_state; exo_det_steady_state],M_, ...
-                                                    options_,false);
+                                                    options_,~options_.steadystate.nocheck);
     if info(1)
         return;
     end
diff --git a/matlab/model_diagnostics.m b/matlab/model_diagnostics.m
index f6029c9548..fb86aa4837 100644
--- a/matlab/model_diagnostics.m
+++ b/matlab/model_diagnostics.m
@@ -111,7 +111,7 @@ if options_.logged_steady_state %if steady state was previously logged, undo thi
     oo_.steady_state=exp(oo_.steady_state);
     options_.logged_steady_state=0;
 end
-[dr.ys,M_.params,check1]=evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,options_.steadystate.nocheck);
+[dr.ys,M_.params,check1]=evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck);
 
 if isfield(M_,'occbin')
     if any(oo_.exo_steady_state)
diff --git a/tests/prior_posterior_function/posterior_function_demo.m b/tests/prior_posterior_function/posterior_function_demo.m
index 2710432e80..62dfefa5eb 100644
--- a/tests/prior_posterior_function/posterior_function_demo.m
+++ b/tests/prior_posterior_function/posterior_function_demo.m
@@ -49,7 +49,7 @@ output_cell{1,1}=mean(xparam1);
 % set the parameters draws to the model structure
 M_ = set_all_parameters(xparam1,estim_params_,M_);
 % compute the steady state for the parameter draw written to M_
-[ys,params,info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,false);
+[ys,params,info] = evaluate_steady_state(oo_.steady_state,[oo_.exo_steady_state; oo_.exo_det_steady_state],M_,options_,~options_.steadystate.nocheck);
 
 %set second part of output cell
 output_cell{1,2}=ys';
-- 
GitLab