From 330b10ec856a228ce446ce9dc41d79781c9d4e37 Mon Sep 17 00:00:00 2001 From: Willi Mutschler <willi@mutschler.eu> Date: Tue, 19 Sep 2023 13:16:49 +0200 Subject: [PATCH] cosmetical changes to headers and comments --- matlab/+mom/default_option_mom_values.m | 1 + matlab/PlotPosteriorDistributions.m | 12 ++++++------ matlab/mode_check.m | 4 ++-- .../utilities/estimation/check_hessian_at_the_mode.m | 4 ++-- matlab/utilities/estimation/check_mode_file.m | 4 ++-- .../utilities/estimation/check_prior_stderr_corr.m | 4 ++-- .../check_steady_state_changes_parameters.m | 4 ++-- .../check_varobs_are_endo_and_declared_once.m | 4 ++-- .../estimation/set_mcmc_jumping_covariance.m | 4 ++-- matlab/utilities/estimation/set_mcmc_prior_bounds.m | 2 +- .../estimation/tune_mcmc_mh_jscale_wrapper.m | 7 +++---- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/matlab/+mom/default_option_mom_values.m b/matlab/+mom/default_option_mom_values.m index c0bc017d24..9a27c76134 100644 --- a/matlab/+mom/default_option_mom_values.m +++ b/matlab/+mom/default_option_mom_values.m @@ -29,6 +29,7 @@ function options_mom_ = default_option_mom_values(options_mom_, options_, dname, % o user_has_matlab_license % o user_has_octave_forge_package % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. diff --git a/matlab/PlotPosteriorDistributions.m b/matlab/PlotPosteriorDistributions.m index 7da52aa723..6a5cec13d0 100644 --- a/matlab/PlotPosteriorDistributions.m +++ b/matlab/PlotPosteriorDistributions.m @@ -4,14 +4,14 @@ function oo_ = PlotPosteriorDistributions(estim_params_, M_, options_, bayestopt % plots posterior distributions % % INPUTS -% estim_params_ [structure] -% M_ [structure] -% options_ [structure] -% bayestopt_ [structure] -% oo_ [structure] +% estim_params_ [structure] information on estimated paramters +% M_ [structure] information on model +% options_ [structure] information on options +% bayestopt_ [structure] information on priors +% oo_ [structure] results % % OUTPUTS -% oo_ [structure] +% oo_ [structure] updated results % % SPECIAL REQUIREMENTS % none diff --git a/matlab/mode_check.m b/matlab/mode_check.m index 7b6e89ff42..a7db27a108 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -4,7 +4,7 @@ function mcheck = mode_check(fun,xparam,hessian_mat,options_,M_,estim_params_,ba % Checks the estimated ML or Posterior mode/minimum by plotting sections of % the likelihood/posterior kernel. Each plot shows the variation of the % function implied by the variations of a single parameter ( ceteris paribus) -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % - fun: [func_handle] objective function % - xparam: [vector] estimated mode/minimum @@ -25,6 +25,7 @@ function mcheck = mode_check(fun,xparam,hessian_mat,options_,M_,estim_params_,ba % - dynare_estimation_1 % - mom.run % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -41,7 +42,6 @@ function mcheck = mode_check(fun,xparam,hessian_mat,options_,M_,estim_params_,ba % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= tolBounds = 1e-8; diff --git a/matlab/utilities/estimation/check_hessian_at_the_mode.m b/matlab/utilities/estimation/check_hessian_at_the_mode.m index 8fa880253f..1e91bf6661 100644 --- a/matlab/utilities/estimation/check_hessian_at_the_mode.m +++ b/matlab/utilities/estimation/check_hessian_at_the_mode.m @@ -2,7 +2,7 @@ function check_hessian_at_the_mode(hessian_xparam1, xparam1, M_, estim_params_, % check_hessian_at_the_mode(hessian_xparam1, xparam1, M_, estim_params_, options_, bounds) % ------------------------------------------------------------------------- % This function checks whether the hessian matrix at the mode is positive definite. -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o hessian_xparam1: [matrix] hessian matrix at the mode % o xparam1: [vector] vector of parameter values at the mode @@ -17,6 +17,7 @@ function check_hessian_at_the_mode(hessian_xparam1, xparam1, M_, estim_params_, % This function is called by % o dynare_estimation_1.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -33,7 +34,6 @@ function check_hessian_at_the_mode(hessian_xparam1, xparam1, M_, estim_params_, % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= try chol(hessian_xparam1); diff --git a/matlab/utilities/estimation/check_mode_file.m b/matlab/utilities/estimation/check_mode_file.m index 29ddb1e846..040c74a80e 100644 --- a/matlab/utilities/estimation/check_mode_file.m +++ b/matlab/utilities/estimation/check_mode_file.m @@ -2,7 +2,7 @@ function [xparam1, hh] = check_mode_file(xparam1, hh, options_, bayestopt_) % function [xparam1, hh] = check_mode_file(xparam1, hh, options_, bayestopt_) % ------------------------------------------------------------------------- % Check that the provided mode_file is compatible with the current estimation settings. -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o xparam1: [vector] current vector of parameter values at the mode % o hh: [matrix] current hessian matrix at the mode @@ -16,6 +16,7 @@ function [xparam1, hh] = check_mode_file(xparam1, hh, options_, bayestopt_) % This function is called by % o dynare_estimation_init.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -32,7 +33,6 @@ function [xparam1, hh] = check_mode_file(xparam1, hh, options_, bayestopt_) % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= number_of_estimated_parameters = length(xparam1); mode_file = load(options_.mode_file); diff --git a/matlab/utilities/estimation/check_prior_stderr_corr.m b/matlab/utilities/estimation/check_prior_stderr_corr.m index 0cdc7b71c1..867e0ba7cd 100644 --- a/matlab/utilities/estimation/check_prior_stderr_corr.m +++ b/matlab/utilities/estimation/check_prior_stderr_corr.m @@ -3,7 +3,7 @@ function check_prior_stderr_corr(estim_params_,bayestopt_) % ------------------------------------------------------------------------- % Check if the prior allows for negative standard deviations and % correlations larger than +-1. If so, issue a warning. -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o estim_params_: [struct] information on estimated parameters % o bayestopt_: [struct] information on priors @@ -14,6 +14,7 @@ function check_prior_stderr_corr(estim_params_,bayestopt_) % This function is called by % o initial_estimation_checks.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -30,7 +31,6 @@ function check_prior_stderr_corr(estim_params_,bayestopt_) % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= nvx = estim_params_.nvx; % number of stderr parameters for structural shocks if nvx && any(bayestopt_.p3(1:nvx)<0) diff --git a/matlab/utilities/estimation/check_steady_state_changes_parameters.m b/matlab/utilities/estimation/check_steady_state_changes_parameters.m index 1cd40b2930..9f6bdfcea0 100644 --- a/matlab/utilities/estimation/check_steady_state_changes_parameters.m +++ b/matlab/utilities/estimation/check_steady_state_changes_parameters.m @@ -2,7 +2,7 @@ function [steady_state, info, steady_state_changes_parameters] = check_steady_st % function [steady_state, info, steady_state_changes_parameters] = check_steady_state_changes_parameters(M_,estim_params_,oo_,options_,steadystate_check_flag_vec) % ------------------------------------------------------------------------- % Check if steady-state solves static model and if it changes estimated parameters -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o M_: [struct] information on the model % o estim_params_: [struct] information on estimated parameters @@ -18,6 +18,7 @@ function [steady_state, info, steady_state_changes_parameters] = check_steady_st % This function is called by % o initial_estimation_checks.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -34,7 +35,6 @@ function [steady_state, info, steady_state_changes_parameters] = check_steady_st % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= value_parameter_change = 1.01; % value with which parameters are slightly changed. steady_state_changes_parameters = false; % initialize diff --git a/matlab/utilities/estimation/check_varobs_are_endo_and_declared_once.m b/matlab/utilities/estimation/check_varobs_are_endo_and_declared_once.m index 75daffc917..1cb92635da 100644 --- a/matlab/utilities/estimation/check_varobs_are_endo_and_declared_once.m +++ b/matlab/utilities/estimation/check_varobs_are_endo_and_declared_once.m @@ -4,7 +4,7 @@ function check_varobs_are_endo_and_declared_once(varobs,endo_names) % Check that each declared observed variable: % - is also an endogenous variable % - is declared only once -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o varobs: [cell] list of observed variables % o endo_names: [cell] list of endogenous variables @@ -15,6 +15,7 @@ function check_varobs_are_endo_and_declared_once(varobs,endo_names) % This function is called by % o dynare_estimation_init.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -31,7 +32,6 @@ function check_varobs_are_endo_and_declared_once(varobs,endo_names) % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= number_of_observed_variables = length(varobs); for i = 1:number_of_observed_variables diff --git a/matlab/utilities/estimation/set_mcmc_jumping_covariance.m b/matlab/utilities/estimation/set_mcmc_jumping_covariance.m index b0cb99d498..6902d509fe 100644 --- a/matlab/utilities/estimation/set_mcmc_jumping_covariance.m +++ b/matlab/utilities/estimation/set_mcmc_jumping_covariance.m @@ -2,7 +2,7 @@ function invhess = set_mcmc_jumping_covariance(invhess, xparam_nbr, MCMC_jumping % function invhess = set_mcmc_jumping_covariance(invhess, xparam_nbr, MCMC_jumping_covariance, bayestopt_, stringForErrors) % ------------------------------------------------------------------------- % sets the jumping covariance matrix for the MCMC algorithm -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o invhess: [matrix] already computed inverse of the hessian matrix % o xparam_nbr: [integer] number of estimated parameters @@ -16,6 +16,7 @@ function invhess = set_mcmc_jumping_covariance(invhess, xparam_nbr, MCMC_jumping % This function is called by % o dynare_estimation_1.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -32,7 +33,6 @@ function invhess = set_mcmc_jumping_covariance(invhess, xparam_nbr, MCMC_jumping % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= switch MCMC_jumping_covariance case 'hessian' % do nothing and use hessian from previous mode optimization diff --git a/matlab/utilities/estimation/set_mcmc_prior_bounds.m b/matlab/utilities/estimation/set_mcmc_prior_bounds.m index 76bbf09ca4..a94b7b9c6d 100644 --- a/matlab/utilities/estimation/set_mcmc_prior_bounds.m +++ b/matlab/utilities/estimation/set_mcmc_prior_bounds.m @@ -15,6 +15,7 @@ function bounds = set_mcmc_prior_bounds(xparam, bayestopt_, options_, stringForE % This function is called by % o dynare_estimation_1.m % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -31,7 +32,6 @@ function bounds = set_mcmc_prior_bounds(xparam, bayestopt_, options_, stringForE % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= bounds = prior_bounds(bayestopt_, options_.prior_trunc); outside_bound_pars = find(xparam < bounds.lb | xparam > bounds.ub); diff --git a/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m b/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m index d0be1e6e87..0da796f513 100644 --- a/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m +++ b/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m @@ -3,7 +3,7 @@ function mh_jscale = tune_mcmc_mh_jscale_wrapper(invhess, options_, M_, objectiv % ------------------------------------------------------------------------- % Wrapper to call the algorithm to tune the jumping scale parameter for the % Metropolis-Hastings algorithm; currently only supports RW-MH algorithm. -% ========================================================================= +% ------------------------------------------------------------------------- % INPUTS % o invhess: [matrix] jumping covariance matrix % o options_: [struct] Dynare options @@ -17,8 +17,9 @@ function mh_jscale = tune_mcmc_mh_jscale_wrapper(invhess, options_, M_, objectiv % o mh_jscale: [double] tuned jumping scale parameter % ------------------------------------------------------------------------- % This function is called by -% o dynare_estimation_1.m +% o dynare_estimation_1 % ------------------------------------------------------------------------- + % Copyright © 2023 Dynare Team % % This file is part of Dynare. @@ -35,9 +36,7 @@ function mh_jscale = tune_mcmc_mh_jscale_wrapper(invhess, options_, M_, objectiv % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <https://www.gnu.org/licenses/>. -% ========================================================================= -% get invhess in case of use_mh_covariance_matrix posterior_sampler_options_temp = options_.posterior_sampler_options.current_options; posterior_sampler_options_temp.invhess = invhess; posterior_sampler_options_temp = check_posterior_sampler_options(posterior_sampler_options_temp, M_.fname, M_.dname, options_); -- GitLab