From 0f19774b554be538f3a925e9dbe8a162acc0ea5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 27 Jan 2021 15:18:14 +0100 Subject: [PATCH] check_bounds_and_definiteness_estimation: rename last argument to BoundsInfo The previous name was misleading, since this is not the same as bayestopt_. The confusion was introduced in cfe1069367d0b1f5f994fe5621ffdd8e251e520e. --- ...check_bounds_and_definiteness_estimation.m | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/matlab/check_bounds_and_definiteness_estimation.m b/matlab/check_bounds_and_definiteness_estimation.m index 8876664dd..f93598c9f 100644 --- a/matlab/check_bounds_and_definiteness_estimation.m +++ b/matlab/check_bounds_and_definiteness_estimation.m @@ -1,12 +1,12 @@ -function [fval,info,exit_flag,Q,H]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, bayestopt_) -% function [fval,info,exit_flag]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, bayestopt_) +function [fval,info,exit_flag,Q,H]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, bounds) +% function [fval,info,exit_flag]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, bounds) % Checks whether parameter vector satisfies % % INPUTS % - xparam1 [double] n by 1 vector, estimated parameters. % - M_ [struct] Matlab's structure describing the Model. % - estim_params_ [struct] Matlab's structure describing the estimated_parameters. -% - bayestopt_ [struct] Matlab's structure specifying the bounds on the paramater values (initialized by dynare,aka bayesopt_). +% - bounds [struct] Matlab's structure specifying the bounds on the paramater values (initialized by dynare_estimation_init). % % OUTPUTS % - fval [double] scalar, value of the likelihood or posterior kernel. @@ -15,7 +15,7 @@ function [fval,info,exit_flag,Q,H]=check_bounds_and_definiteness_estimation(xpar % - Q [matrix] Covariance matrix of structural shocks % - H [matrix] Covariance matrix of measurement errors -% Copyright (C) 2020 Dynare Team +% Copyright (C) 2020-2021 Dynare Team % % This file is part of Dynare. % @@ -38,22 +38,22 @@ info = zeros(4,1); Q=[]; H=[]; % Return, with endogenous penalty, if some parameters are smaller than the lower bound of the prior domain. -if any(xparam1bayestopt_.ub) - k = find(xparam1(:)>bayestopt_.ub); +if any(xparam1>bounds.ub) + k = find(xparam1(:)>bounds.ub); fval = Inf; exit_flag = 0; info(1) = 42; - info(4) = sum((xparam1(k)-bayestopt_.ub(k)).^2); + info(4) = sum((xparam1(k)-bounds.ub(k)).^2); return end @@ -103,4 +103,4 @@ if ~issquare(H) || estim_params_.ncn || isfield(estim_params_,'calibrated_covari return end end -end \ No newline at end of file +end