From f679594908ab713b9182d16bd151197f9893c5bb Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sat, 25 Jul 2015 07:32:48 +0200 Subject: [PATCH] Add check whether bayestopt_ is empty Otherwise crashes for calibrated smoother occur --- matlab/dynare_estimation_init.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index e712e7e27..b6552d9a0 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -148,7 +148,7 @@ if ~isempty(estim_params_) [xparam1,estim_params_,bayestopt_,lb,ub,M_] = set_prior(estim_params_,M_,options_); end -if any(bayestopt_.pshape==0) && any(bayestopt_.pshape~=0) +if ~isempty(bayestopt_) && any(bayestopt_.pshape==0) && any(bayestopt_.pshape~=0) error('Estimation must be either fully ML or fully Bayesian. Maybe you forgot to specify a prior distribution.') end % Check if a _prior_restrictions.m file exists