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 cfe1069367
.
time-shift
parent
25d19fef96
commit
0f19774b55
|
@ -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,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_, bayestopt_)
|
% function [fval,info,exit_flag]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, bounds)
|
||||||
% Checks whether parameter vector satisfies
|
% Checks whether parameter vector satisfies
|
||||||
%
|
%
|
||||||
% INPUTS
|
% INPUTS
|
||||||
% - xparam1 [double] n by 1 vector, estimated parameters.
|
% - xparam1 [double] n by 1 vector, estimated parameters.
|
||||||
% - M_ [struct] Matlab's structure describing the Model.
|
% - M_ [struct] Matlab's structure describing the Model.
|
||||||
% - estim_params_ [struct] Matlab's structure describing the estimated_parameters.
|
% - 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
|
% OUTPUTS
|
||||||
% - fval [double] scalar, value of the likelihood or posterior kernel.
|
% - 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
|
% - Q [matrix] Covariance matrix of structural shocks
|
||||||
% - H [matrix] Covariance matrix of measurement errors
|
% - H [matrix] Covariance matrix of measurement errors
|
||||||
|
|
||||||
% Copyright (C) 2020 Dynare Team
|
% Copyright (C) 2020-2021 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -38,22 +38,22 @@ info = zeros(4,1);
|
||||||
Q=[];
|
Q=[];
|
||||||
H=[];
|
H=[];
|
||||||
% Return, with endogenous penalty, if some parameters are smaller than the lower bound of the prior domain.
|
% Return, with endogenous penalty, if some parameters are smaller than the lower bound of the prior domain.
|
||||||
if any(xparam1<bayestopt_.lb)
|
if any(xparam1<bounds.lb)
|
||||||
k = find(xparam1(:) < bayestopt_.lb);
|
k = find(xparam1(:) < bounds.lb);
|
||||||
fval = Inf;
|
fval = Inf;
|
||||||
exit_flag = 0;
|
exit_flag = 0;
|
||||||
info(1) = 41;
|
info(1) = 41;
|
||||||
info(4) = sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
info(4) = sum((bounds.lb(k)-xparam1(k)).^2);
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
% Return, with endogenous penalty, if some parameters are greater than the upper bound of the prior domain.
|
% Return, with endogenous penalty, if some parameters are greater than the upper bound of the prior domain.
|
||||||
if any(xparam1>bayestopt_.ub)
|
if any(xparam1>bounds.ub)
|
||||||
k = find(xparam1(:)>bayestopt_.ub);
|
k = find(xparam1(:)>bounds.ub);
|
||||||
fval = Inf;
|
fval = Inf;
|
||||||
exit_flag = 0;
|
exit_flag = 0;
|
||||||
info(1) = 42;
|
info(1) = 42;
|
||||||
info(4) = sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
info(4) = sum((xparam1(k)-bounds.ub(k)).^2);
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -103,4 +103,4 @@ if ~issquare(H) || estim_params_.ncn || isfield(estim_params_,'calibrated_covari
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue