From bc048b2363e4ecfb4f664fcc2bf473ea97c9b4b0 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Mon, 14 Apr 2025 11:16:27 +0200 Subject: [PATCH] :bug: identification: shut off slice_initialize_with_mode option with slice to prevent crash Closes https://git.dynare.org/Dynare/dynare/-/issues/1957 --- matlab/+identification/run.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/matlab/+identification/run.m b/matlab/+identification/run.m index 203f2cb77d..54c5fea521 100644 --- a/matlab/+identification/run.m +++ b/matlab/+identification/run.m @@ -300,6 +300,11 @@ options_.analytic_derivation=options_ident.analytic_derivation; % 1: analytic derivation of gradient and hessian of likelihood in dsge_likelihood.m, only works for stationary models, i.e. kalman_algo<3 options_ = set_default_option(options_,'datafile',''); options_.mode_compute = 0; +if strcmp('slice',options_.posterior_sampler_options.posterior_sampling_method) + if strfind(options_.posterior_sampler_options.sampling_opt,'slice_initialize_with_mode'',1') + options_.posterior_sampler_options.sampling_opt=strrep(options_.posterior_sampler_options.sampling_opt,'slice_initialize_with_mode'',1','slice_initialize_with_mode'',0') % reset option to prevent crash in check_posterior_sampler_options.m if mode_compute is set to 0, see https://git.dynare.org/Dynare/dynare/-/issues/1957 + end +end options_.plot_priors = 0; options_.smoother = 1; options_.options_ident = []; -- GitLab