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)')