From 30c17ad346dcac307ad5061dee96b04072c8fb0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 14 Jun 2023 19:14:07 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Steady=20state:=20wrong=20value?=
 =?UTF-8?q?=20of=20maxit=20was=20used=20for=20some=20block/bytecode=20case?=
 =?UTF-8?q?s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It was using the value of maxit for perfect foresight simulations.
---
 matlab/evaluate_steady_state.m | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/matlab/evaluate_steady_state.m b/matlab/evaluate_steady_state.m
index 0ee5b29a07..4de31803f9 100644
--- a/matlab/evaluate_steady_state.m
+++ b/matlab/evaluate_steady_state.m
@@ -361,7 +361,7 @@ elseif ~options.bytecode && options.block
             mfs_idx = M.block_structure_stat.block(b).variable(end-M.block_structure_stat.block(b).mfs+1:end);
             if options.solve_algo <= 4 || options.solve_algo >= 9
                 [ys(mfs_idx), errorflag] = dynare_solve(@block_mfs_steadystate, ys(mfs_idx), ...
-                                                        options.simul.maxit, options.solve_tolf, options.solve_tolx, ...
+                                                        options.steady.maxit, options.solve_tolf, options.solve_tolx, ...
                                                         options, fh_static, b, ys, exo_ss, params, T, M);
                 if errorflag
                     check = 1;
@@ -370,7 +370,7 @@ elseif ~options.bytecode && options.block
             else
                 nze = length(M.block_structure_stat.block(b).g1_sparse_rowval);
                 [ys, T, success] = solve_one_boundary(fh_static, ys, exo_ss, ...
-                                                      params, [], T, mfs_idx, nze, 1, false, b, 0, options.simul.maxit, ...
+                                                      params, [], T, mfs_idx, nze, 1, false, b, 0, options.steady.maxit, ...
                                                       options.solve_tolf, ...
                                                       0, options.solve_algo, true, false, false, M, options);
                 if ~success
@@ -406,7 +406,7 @@ elseif options.bytecode
                     M.block_structure_stat.block(b).Simulation_Type ~= 2
                 mfs_idx = M.block_structure_stat.block(b).variable(end-M.block_structure_stat.block(b).mfs+1:end);
                 [ys(mfs_idx), errorflag] = dynare_solve(@block_bytecode_mfs_steadystate, ...
-                                                        ys(mfs_idx), options.simul.maxit, ...
+                                                        ys(mfs_idx), options.steady.maxit, ...
                                                         options.solve_tolf, options.solve_tolx, ...
                                                         options, b, ys, exo_ss, params, T, M);
                 if errorflag
@@ -427,7 +427,7 @@ elseif options.bytecode
         end
     else
         [ys, check] = dynare_solve(@bytecode_steadystate, ys_init, ...
-                                   options.simul.maxit, options.solve_tolf, options.solve_tolx, ...
+                                   options.steady.maxit, options.solve_tolf, options.solve_tolx, ...
                                    options, exo_ss, params);
     end
 end
-- 
GitLab