2015-05-09 15:34:37 +02:00
|
|
|
function [xparams,lpd,hessian_mat] = ...
|
2015-02-23 18:26:34 +01:00
|
|
|
maximize_prior_density(iparams, prior_shape, prior_hyperparameter_1, prior_hyperparameter_2, prior_inf_bound, prior_sup_bound,DynareOptions,DynareModel,BayesInfo,EstimatedParams,DynareResults)
|
2009-06-05 12:16:31 +02:00
|
|
|
% Maximizes the logged prior density using Chris Sims' optimization routine.
|
2017-05-16 15:10:20 +02:00
|
|
|
%
|
|
|
|
% INPUTS
|
2009-06-05 12:16:31 +02:00
|
|
|
% iparams [double] vector of initial parameters.
|
|
|
|
% prior_shape [integer] vector specifying prior densities shapes.
|
|
|
|
% prior_hyperparameter_1 [double] vector, first hyperparameter.
|
|
|
|
% prior_hyperparameter_2 [double] vector, second hyperparameter.
|
|
|
|
% prior_inf_bound [double] vector, prior's lower bound.
|
2017-05-16 15:10:20 +02:00
|
|
|
% prior_sup_bound [double] vector, prior's upper bound.
|
2009-06-05 12:16:31 +02:00
|
|
|
%
|
2017-05-16 15:10:20 +02:00
|
|
|
% OUTPUTS
|
2009-06-05 12:16:31 +02:00
|
|
|
% xparams [double] vector, prior mode.
|
|
|
|
% lpd [double] scalar, value of the logged prior density at the mode.
|
2015-05-09 15:34:37 +02:00
|
|
|
% hessian_mat [double] matrix, Hessian matrix at the prior mode.
|
2009-06-05 12:16:31 +02:00
|
|
|
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2009-2017 Dynare Team
|
2009-06-05 12:16:31 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2009-06-05 12:16:31 +02:00
|
|
|
|
2015-05-09 15:34:37 +02:00
|
|
|
[xparams, lpd, exitflag, hessian_mat]=dynare_minimize_objective('minus_logged_prior_density', ...
|
2015-02-23 18:26:34 +01:00
|
|
|
iparams, DynareOptions.mode_compute, DynareOptions, [prior_inf_bound, prior_sup_bound], ...
|
|
|
|
BayesInfo.name, BayesInfo, [], ...
|
|
|
|
prior_shape, prior_hyperparameter_1, prior_hyperparameter_2, prior_inf_bound, prior_sup_bound, ...
|
|
|
|
DynareOptions,DynareModel,EstimatedParams,DynareResults);
|
2009-12-16 18:17:34 +01:00
|
|
|
|
|
|
|
lpd = -lpd;
|