From f19ccf7f81df9dac6415026c19416f602a833c0b Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Mon, 3 Feb 2025 08:46:52 +0100 Subject: [PATCH] Set default prior_trunc=0 Closes #1953 --- doc/manual/source/the-model-file.rst | 2 +- matlab/+gsa/stability_mapping.m | 4 ++++ matlab/default_option_values.m | 2 +- matlab/estimation/dynare_estimation_init.m | 8 ++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst index 60edf8911a..8be7dda09c 100644 --- a/doc/manual/source/the-model-file.rst +++ b/doc/manual/source/the-model-file.rst @@ -7112,7 +7112,7 @@ observed variables. Probability of extreme values of the prior density in each tail that is ignored when computing bounds for the parameters. Default: - ``1e-10``. + ``1e-10`` for ``posterior_sampling_method=slice`` and ``0`` otherwise . .. option:: huge_number = DOUBLE diff --git a/matlab/+gsa/stability_mapping.m b/matlab/+gsa/stability_mapping.m index 8badb3bc7d..b7154f47df 100644 --- a/matlab/+gsa/stability_mapping.m +++ b/matlab/+gsa/stability_mapping.m @@ -92,6 +92,10 @@ xparam1=[]; [~,~,~,lb,ub] = set_prior(estim_params_,M_,options_); %Prepare bounds if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0) % Set prior bounds + if options_.prior_trunc==0 + fprintf('\nstability_mapping: GSA with priors requires bounded support. Setting options_.prior_trunc=1e-10.\n') + options_.prior_trunc=1e-10; + end bounds = prior_bounds(bayestopt_, options_.prior_trunc); bounds.lb = max(bounds.lb,lb); bounds.ub = min(bounds.ub,ub); diff --git a/matlab/default_option_values.m b/matlab/default_option_values.m index 300b4c6114..929079add1 100644 --- a/matlab/default_option_values.m +++ b/matlab/default_option_values.m @@ -452,7 +452,7 @@ options_.mh_posterior_mode_estimation = false; options_.smc_posterior_mode_estimation = false; options_.prefilter = 0; options_.presample = 0; -options_.prior_trunc = 1e-10; +options_.prior_trunc = 0; options_.smoother = false; options_.smoother_redux = false; options_.posterior_max_subsample_draws = 1200; diff --git a/matlab/estimation/dynare_estimation_init.m b/matlab/estimation/dynare_estimation_init.m index ffa982c0c2..60b188432f 100644 --- a/matlab/estimation/dynare_estimation_init.m +++ b/matlab/estimation/dynare_estimation_init.m @@ -117,6 +117,14 @@ if isequal(options_.diffuse_filter,1) || (options_.kalman_algo>2) end end +if strcmp('slice',options_.posterior_sampler_options.posterior_sampling_method) + if options_.prior_trunc==0 + fprintf('\ndynare_estimation_init: slice requires bounded support. Setting options_.prior_trunc=1e-10.\n') + options_.prior_trunc=1e-10; + end +end + + options_=select_qz_criterium_value(options_); % Set options related to filtered variables. -- GitLab