From a0238398908e2fd6dd49e4f6cf64528640092bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 5 Jun 2017 10:51:30 +0200 Subject: [PATCH] Fixed bug instroduced in e5945a45275ea6bc5422c216c5a1052f167423bd. --- matlab/dynare_estimation_init.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 0d3824fd5..8b174f66c 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -50,6 +50,7 @@ function [dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, % along with Dynare. If not, see . hh = []; +xparam1 = []; if isempty(gsa_flag) gsa_flag = 0; @@ -310,7 +311,8 @@ if options_.use_calibration_initialization %set calibration as starting values [xparam1,estim_params_]=do_parameter_initialization(estim_params_,xparam1_calib,xparam1); %get explicitly initialized parameters that have precedence to calibrated values end end -if all(bayestopt_.pshape==0) && any(isnan(xparam1)) + +if ~isempty(bayestopt_) && all(bayestopt_.pshape==0) && any(isnan(xparam1)) error('ML estimation requires all estimated parameters to be initialized, either in an estimated_params or estimated_params_init-block ') end