From 208c7d02ab8b5c185fad8bfbcaf11cd959dd2e22 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Mon, 2 Mar 2020 12:57:08 +0100
Subject: [PATCH] stoch_simul: handle case where hessian was not computed by
 the preprocessor

occurs when .mod file was run outside of the GUI and order was set to 1 in one of the computation commands
---
 src/gui_stoch_simulation.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gui_stoch_simulation.m b/src/gui_stoch_simulation.m
index cf65154..b7ea454 100644
--- a/src/gui_stoch_simulation.m
+++ b/src/gui_stoch_simulation.m
@@ -217,6 +217,9 @@ uicontrol( ...
             backup = gui_auxiliary.backup_options(options_);
             options_ = default_option_values(M_);
             options_ = gui_auxiliary.add_backup_to_options(options_, backup);
+            if ~isfield(M_, 'hessian_eq_zero')
+                options_.order = 1;
+            end
             if any([handles.shocksTable.Data{:,1}])
                 options_.irf_shocks = char(handles.shocksTable.Data([handles.shocksTable.Data{:,1}],2));
             end
-- 
GitLab