From 9f63c4081f5893fb5f4f3c67cde7c038db987180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 18 Sep 2013 11:33:14 +0200 Subject: [PATCH] Fixed bug affecting fs2000/fs2000_calib.mod and shock_decomp_calibrated_model/example1_calib_shock_decomp.mod. --- matlab/dynare_estimation_init.m | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index a8dd7c593..2d847e6e5 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -218,8 +218,8 @@ if ~isempty(estim_params_) && ~isempty(options_.mode_file) && ~options_.mh_poste skipline() end -if ~isempty(estim_params_) % estimated parameters - if any(bayestopt_.pshape > 0) % declared priors +if ~isempty(estim_params_) + if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0) % Plot prior densities. if ~options_.nograph && options_.plot_priors plot_priors(bayestopt_,M_,estim_params_,options_) @@ -235,11 +235,7 @@ if ~isempty(estim_params_) % estimated parameters bounds(:,1) = lb; bounds(:,2) = ub; end -end - -if ~isempty(estim_params_) - % Test if initial values of the estimated parameters are all between - % the prior lower and upper bounds. + % Test if initial values of the estimated parameters are all between the prior lower and upper bounds. outside_bound_pars=find(xparam1 < bounds(:,1) | xparam1 > bounds(:,2)); if ~isempty(outside_bound_pars) for ii=1:length(outside_bound_pars) @@ -257,7 +253,6 @@ if ~isempty(estim_params_) bayestopt_.ub = ub; end - if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model) if ~options_.smoother error('ESTIMATION: the ''estimated_params'' block is mandatory (unless you are running a smoother)')