From e16d0b5314ff986be9b9ea5f15697ba95420ef2e Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Thu, 14 Sep 2017 09:48:26 +0200 Subject: [PATCH] Make sure prior distribution is set up without prior estimation command (cherry picked from commit 8fa50ad009d52801b9c8d90420d6dbe48956818e) --- matlab/execute_prior_posterior_function.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/matlab/execute_prior_posterior_function.m b/matlab/execute_prior_posterior_function.m index 7e77a6ae8..1370ab34e 100644 --- a/matlab/execute_prior_posterior_function.m +++ b/matlab/execute_prior_posterior_function.m @@ -62,6 +62,13 @@ if strcmpi(type,'posterior') n_draws=options_.sub_draws; prior = false; elseif strcmpi(type,'prior') + if isempty(bayestopt_) + if ~isempty(estim_params_) && ~(isfield(estim_params_,'nvx') && (size(estim_params_.var_exo,1)+size(estim_params_.var_endo,1)+size(estim_params_.corrx,1)+size(estim_params_.corrn,1)+size(estim_params_.param_vals,1))==0) + [xparam1,estim_params_,bayestopt_,lb,ub,M_] = set_prior(estim_params_,M_,options_); + else + error('The prior distributions are not properly set up.') + end + end prior_draw(bayestopt_, options_.prior_trunc); else error('EXECUTE_POSTERIOR_FUNCTION: Unknown type!') -- GitLab