From be25c0db112c8e02751942d2548b5c487b837ab1 Mon Sep 17 00:00:00 2001 From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152> Date: Fri, 20 Feb 2009 16:57:51 +0000 Subject: [PATCH] 4.0: merged r2433 revision from trunk (changed to GPL headers in Marco Ratto's files) + did the same for DsgeLikelihood_hh.m git-svn-id: https://www.dynare.org/svn/dynare/branches/4.0@2434 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/DsgeLikelihood_hh.m | 23 ++++++++++++++++++----- matlab/dynare_sensitivity.m | 28 +++++++++++++++++----------- matlab/mr_gstep.m | 19 +++++++++++++++++-- matlab/mr_hessian.m | 23 +++++++++++++++++++---- matlab/newrat.m | 19 ++++++++++++++++--- 5 files changed, 87 insertions(+), 25 deletions(-) diff --git a/matlab/DsgeLikelihood_hh.m b/matlab/DsgeLikelihood_hh.m index 88d9addb33..c90641c719 100644 --- a/matlab/DsgeLikelihood_hh.m +++ b/matlab/DsgeLikelihood_hh.m @@ -1,6 +1,6 @@ -function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data) +function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood_hh(xparam1,gend,data) -% function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data) +% function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood_hh(xparam1,gend,data) % Evaluates the likelihood at each observation and the marginal density of a dsge model % used in the optimization algorithm number 5 % @@ -19,10 +19,23 @@ function [fval,llik,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend % % SPECIAL REQUIREMENTS % Adapted from dsgelikelihood.m -% -% copyright marco.ratto@jrc.it [13-03-2007] - +% Copyright (C) 2006-2009 Dynare Team +% +% 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 +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. global bayestopt_ estim_params_ options_ trend_coeff_ M_ oo_ xparam1_test diff --git a/matlab/dynare_sensitivity.m b/matlab/dynare_sensitivity.m index d49a39fa3f..a8c83a0aca 100644 --- a/matlab/dynare_sensitivity.m +++ b/matlab/dynare_sensitivity.m @@ -1,19 +1,25 @@ function x0=dynare_sensitivity(options_gsa) -% Part of the Sensitivity Analysis Toolbox for DYNARE +% Frontend to the Sensitivity Analysis Toolbox for DYNARE % -% Written by Marco Ratto, 2006 -% Joint Research Centre, The European Commission, -% (http://eemc.jrc.ec.europa.eu/), -% marco.ratto@jrc.it -% -% Disclaimer: This software is not subject to copyright protection and is in the public domain. -% It is an experimental system. The Joint Research Centre of European Commission -% assumes no responsibility whatsoever for its use by other parties -% and makes no guarantees, expressed or implied, about its quality, reliability, or any other -% characteristic. We would appreciate acknowledgement if the software is used. % Reference: % M. Ratto, Global Sensitivity Analysis for Macroeconomic models, MIMEO, 2006. + +% Copyright (C) 2008 Dynare Team +% +% 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 +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. global M_ options_ oo_ bayestopt_ estim_params_ diff --git a/matlab/mr_gstep.m b/matlab/mr_gstep.m index 75ac04e63e..7c36e1017c 100644 --- a/matlab/mr_gstep.m +++ b/matlab/mr_gstep.m @@ -1,10 +1,25 @@ function [f0, x, ig] = mr_gstep(func0,x,htol0,varargin) -% Copyright (C) 2005 Marco Ratto -% % function [f0, x] = mr_gstep(func0,x,htol0,varargin) % % Gibbs type step in optimisation +% Copyright (C) 2006 Dynare Team +% +% 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 +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + global bayestopt_ options_ persistent h1 diff --git a/matlab/mr_hessian.m b/matlab/mr_hessian.m index 57bc4872c9..14e7a59906 100644 --- a/matlab/mr_hessian.m +++ b/matlab/mr_hessian.m @@ -1,11 +1,11 @@ -% Copyright (C) 2004 Marco Ratto -% adapted from Michel Juillard original rutine hessian.m -% +function [hessian_mat, gg, htol1, ihh, hh_mat0] = mr_hessian(func,x,hflag,htol0,varargin) % [hessian_mat, gg, htol1, ihh, hh_mat0] = mr_hessian(func,x,hflag,htol0,varargin) % % numerical gradient and Hessian, with 'automatic' check of numerical % error % +% adapted from Michel Juillard original rutine hessian.m +% % func = name of the function: func must give two outputs: % - the log-likelihood AND the single contributions at times t=1,...,T % of the log-likelihood to compute outer product gradient @@ -23,9 +23,24 @@ % derivatives % % varargin: other parameters of func + +% Copyright (C) 2004-2008 Dynare Team +% +% 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 +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. -function [hessian_mat, gg, htol1, ihh, hh_mat0] = mr_hessian(func,x,hflag,htol0,varargin) global options_ bayestopt_ persistent h1 htol diff --git a/matlab/newrat.m b/matlab/newrat.m index 20b4208900..7e84595f01 100644 --- a/matlab/newrat.m +++ b/matlab/newrat.m @@ -1,7 +1,4 @@ function [xparam1, hh, gg, fval, igg] = newrat(func0, x, hh, gg, igg, ftol0, nit, flagg, varargin) -% -% Copyright (C) 2004 Marco Ratto -% % [xparam1, hh, gg, fval, igg] = newrat(func0, x, hh, gg, igg, ftol0, nit, flagg, varargin) % % Optimiser with outer product gradient and 'Gibbs type' steps @@ -27,7 +24,23 @@ function [xparam1, hh, gg, fval, igg] = newrat(func0, x, hh, gg, igg, ftol0, nit % flagg = 2, full numerical Hessian % % varargin = list of parameters for func0 + +% Copyright (C) 2004-2008 Dynare Team +% +% 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 +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. global bayestopt_ icount=0; -- GitLab