From 9eb01eaee2270fa27f3e7a1bd58dddf41f29914d Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Wed, 31 Jan 2018 23:25:03 +0100 Subject: [PATCH] prior bounds: make sure that lower and upper bounds only affect mode-finding https://github.com/DynareTeam/dynare/commit/99dbc8c74d0ecf4c7a610c4a394fd85028cf2741 introduced a bug by disabling the resetting of the prior bounds used for the MCMC. The manual clearly states the bounds are only operational during mode-finding, but not during MCMC (and therefore prior sampling) (cherry picked from commit 127a543b656719dcf4a35be373eec9bbc9dec7d7) --- matlab/dynare_estimation_1.m | 1 + matlab/identification_analysis.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 183612574..8830e9617 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -419,6 +419,7 @@ end if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ... (any(bayestopt_.pshape >0 ) && options_.load_mh_file) %% not ML estimation + bounds = prior_bounds(bayestopt_, options_.prior_trunc); %reset bounds as lb and ub must only be operational during mode-finding outside_bound_pars=find(xparam1 < bounds.lb | xparam1 > bounds.ub); if ~isempty(outside_bound_pars) for ii=1:length(outside_bound_pars) diff --git a/matlab/identification_analysis.m b/matlab/identification_analysis.m index c59e08ec6..31bd50b19 100644 --- a/matlab/identification_analysis.m +++ b/matlab/identification_analysis.m @@ -155,7 +155,7 @@ if info(1)==0 info = stoch_simul(char(options_.varobs)); dataset_ = dseries(oo_.endo_simul(options_.varobs_id,100+1:end)',dates('1Q1'), options_.varobs); derivatives_info.no_DLIK=1; - %bounds = prior_bounds(bayestopt_, options_.prior_trunc); + bounds = prior_bounds(bayestopt_, options_.prior_trunc); %reset bounds as lb and ub must only be operational during mode-finding [fval,info,cost_flag,DLIK,AHess,ys,trend_coeff,M_,options_,bayestopt_,oo_] = dsge_likelihood(params',dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_,derivatives_info); % fval = DsgeLikelihood(xparam1,data_info,options_,M_,estim_params_,bayestopt_,oo_); options_.analytic_derivation = analytic_derivation; -- GitLab