diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index e2c69546c..4925c65b6 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -444,7 +444,11 @@ if ~options_.mh_posterior_mode_estimation && options_.cova_compute end if options_.mode_check == 1 && ~options_.mh_posterior_mode_estimation && options_.cova_compute - mode_check(xparam1,0,hh,gend,data,lb,ub,data_index,number_of_observations,no_more_missing_observations); + if options_.cova_compute + mode_check(xparam1,0,hh,gend,data,lb,ub,data_index,number_of_observations,no_more_missing_observations); + else + mode_check(xparam1,0,[],gend,data,lb,ub,data_index,number_of_observations,no_more_missing_observations); + end end if ~options_.mh_posterior_mode_estimation && options_.cova_compute diff --git a/matlab/mode_check.m b/matlab/mode_check.m index b32eaefc3..b8eaa71fa 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -38,20 +38,25 @@ function mode_check(x,fval,hessian,gend,data,lb,ub,data_index,number_of_observat global bayestopt_ M_ options_ TeX = options_.TeX; -[ s_min, k ] = min(diag(hessian)) ; +if ~isempty(hessian); + [ s_min, k ] = min(diag(hessian)); +end if options_.dsge_var fval = DsgeVarLikelihood(x,gend); else fval = DsgeLikelihood(x,gend,data,data_index,number_of_observations,no_more_missing_observations); end -bayestopt_.penalty=fval; -disp(' ') -disp('MODE CHECK') -disp(' ') -disp(sprintf('Fval obtained by the minimization routine: %f', fval)) -disp(' ') -if s_min