From ce21248e9719d684334a8b30c441ffab62606f78 Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@ec.europa.eu>
Date: Wed, 19 Oct 2022 18:09:54 +0200
Subject: [PATCH] set noprint = true when simulating, to avoid crashes; only
 save info1 file under debug option

---
 matlab/+occbin/DSGE_smoother.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/matlab/+occbin/DSGE_smoother.m b/matlab/+occbin/DSGE_smoother.m
index 2a5d919d53..03d1c560ba 100644
--- a/matlab/+occbin/DSGE_smoother.m
+++ b/matlab/+occbin/DSGE_smoother.m
@@ -139,6 +139,7 @@ opts_simul.exo_pos = 1:M_.exo_nbr;
 opts_simul.endo_init = alphahat(oo_.dr.inv_order_var,1);
 opts_simul.init_regime=regime_history; % use realtime regime for guess, to avoid multiple solution issues!
 options_.occbin.simul=opts_simul;
+options_.noprint = true;
 [~, out, ss] = occbin.solver(M_,oo_,options_);
 regime_history = out.regime_history;
 if options_.smoother_redux
@@ -330,7 +331,9 @@ end
 regime_history0(max(iter+1,1),:) = regime_history;
 oo_.occbin.smoother.regime_history=regime_history0(end,:);
 oo_.occbin.smoother.regime_history_iter=regime_history0;
+if occbin_smoother_debug
 save('info1','regime_history0')
+end
 
 if (maxiter==iter && is_changed) || is_periodic
     disp(['Occbin smoother did not converge.'])
-- 
GitLab