diff --git a/matlab/dsge_likelihood.m b/matlab/dsge_likelihood.m index ae9babbc24c3abd21517cec0d58853b9a51d978d..814c2d1e1ca41e3273b020f581ee29fd564e3e7a 100644 --- a/matlab/dsge_likelihood.m +++ b/matlab/dsge_likelihood.m @@ -132,7 +132,7 @@ function [fval,info,exit_flag,DLIK,Hess,SteadyState,trend_coeff,Model,DynareOpti % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT FR +% Initial author: stephane DOT adjemian AT univ DASH lemans DOT FR % Initialization of the returned variables and others... fval = []; diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 274ed75a19f40e027f90f5d8f71d38ad626a209b..20f16b473e972d93be3e787f4c9b10be833ec7d4 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -228,7 +228,9 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_); options_.analytic_derivation = ana_deriv_old; elseif ~isnumeric(options_.mode_compute) || ~(isequal(options_.mode_compute,5) && newratflag~=1 && strcmp(func2str(objective_function),'dsge_likelihood')) - % with flag==0 or 2, we force to use the hessian from outer product gradient of optimizer 5 + % enter here if i) not mode_compute_5, ii) if mode_compute_5 and newratflag==1; + % with flag==0 or 2 and dsge_likelihood, we force to use + % the hessian from outer product gradient of optimizer 5 below if options_.hessian.use_penalized_objective penalized_objective_function = str2func('penalty_objective_function'); hh = hessian(penalized_objective_function, xparam1, options_.gstep, objective_function, fval, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds,oo_); @@ -237,7 +239,8 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation end hh = reshape(hh, nx, nx); elseif isnumeric(options_.mode_compute) && isequal(options_.mode_compute,5) - % other numerical hessian options available with optimizer 5 + % other numerical hessian options available with optimizer + % 5 and dsge_likelihood % % if newratflag == 0 % compute outer product gradient of optimizer 5