Skip to content
Snippets Groups Projects
Commit e51a30ea authored by Marco Ratto's avatar Marco Ratto
Browse files

Bug fix for the case where no prior is defined for estim params

parent a4dc58db
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,23 @@ if isempty(dataset)
end
options_=select_qz_criterium_value(options_);
[~,~,~,lb,ub] = set_prior(estim_params_,M_,options_);
if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0)
% Plot prior densities.
% Set prior bounds
bounds = prior_bounds(bayestopt_, options_.prior_trunc);
else % estimated parameters but no declared priors
% No priors are declared so Dynare will estimate the model by
% maximum likelihood with inequality constraints for the parameters.
bounds.lb = lb;
bounds.ub = ub;
end
if options_.occbin.likelihood.status && options_.occbin.likelihood.inversion_filter
llik = -occbin.IVF_posterior(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,prior_bounds(bayestopt_,options_.prior_trunc),oo_);
llik = -occbin.IVF_posterior(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
else
llik = -dsge_likelihood(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,prior_bounds(bayestopt_,options_.prior_trunc),oo_);
llik = -dsge_likelihood(parameters,dataset,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
end
ldens = evaluate_prior(parameters,M_,estim_params_,oo_,options_,bayestopt_);
llik = llik - ldens;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment