Move setting of parameters out of check_bounds_and_definiteness_estimation.m
Increases transparencytime-shift
parent
1dbbef9f2e
commit
3b85fea02e
|
@ -1,11 +1,10 @@
|
|||
function [fval,info,exit_flag,M_,Q,H]=check_bounds_and_definiteness_estimation(xparam1, M_, options_, estim_params_, bayestopt_)
|
||||
% function [fval,info,exit_flag]=check_bounds_and_definiteness_estimation(xparam1, M_, options_, estim_params_, bayestopt_)
|
||||
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_)
|
||||
% Checks whether parameter vector satisfies
|
||||
%
|
||||
% INPUTS
|
||||
% - xparam1 [double] n by 1 vector, estimated parameters.
|
||||
% - M_ [struct] Matlab's structure describing the Model.
|
||||
% - options_ [struct] Matlab's structure describing the options.
|
||||
% - 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_).
|
||||
%
|
||||
|
@ -58,8 +57,6 @@ if any(xparam1>bayestopt_.ub)
|
|||
return
|
||||
end
|
||||
|
||||
M_ = set_all_parameters(xparam1,estim_params_,M_);
|
||||
|
||||
Q = M_.Sigma_e;
|
||||
H = M_.H;
|
||||
|
||||
|
|
|
@ -180,8 +180,9 @@ end
|
|||
%------------------------------------------------------------------------------
|
||||
% 1. Get the structural parameters & define penalties
|
||||
%------------------------------------------------------------------------------
|
||||
Model = set_all_parameters(xparam1,EstimatedParameters,Model);
|
||||
|
||||
[fval,info,exit_flag,Model,Q,H]=check_bounds_and_definiteness_estimation(xparam1, Model, DynareOptions, EstimatedParameters, BoundsInfo);
|
||||
[fval,info,exit_flag,Q,H]=check_bounds_and_definiteness_estimation(xparam1, Model, EstimatedParameters, BoundsInfo);
|
||||
if info(1)
|
||||
return
|
||||
end
|
||||
|
|
|
@ -101,7 +101,9 @@ mYX = evalin('base', 'mYX');
|
|||
mXY = evalin('base', 'mXY');
|
||||
mXX = evalin('base', 'mXX');
|
||||
|
||||
[fval,info,exit_flag,Model,Q]=check_bounds_and_definiteness_estimation(xparam1, Model, DynareOptions, EstimatedParameters, BoundsInfo);
|
||||
Model = set_all_parameters(xparam1,EstimatedParameters,Model);
|
||||
|
||||
[fval,info,exit_flag,Q]=check_bounds_and_definiteness_estimation(xparam1, Model, EstimatedParameters, BoundsInfo);
|
||||
if info(1)
|
||||
return
|
||||
end
|
||||
|
|
|
@ -65,7 +65,9 @@ junk2 = [];
|
|||
% 1. Get the structural parameters & define penalties
|
||||
%--------------------------------------------------------------------------
|
||||
|
||||
[fval,info,exit_flag,M_]=check_bounds_and_definiteness_estimation(xparam1, M_, options_mom_, estim_params_, Bounds);
|
||||
M_ = set_all_parameters(xparam1, estim_params_, M_);
|
||||
|
||||
[fval,info,exit_flag]=check_bounds_and_definiteness_estimation(xparam1, M_, estim_params_, Bounds);
|
||||
if info(1)
|
||||
if options_mom_.vector_output == 1 % lsqnonlin requires vector output
|
||||
fval = ones(size(oo_.mom.data_moments,1),1)*options_mom_.huge_number;
|
||||
|
|
|
@ -63,7 +63,9 @@ end
|
|||
% 1. Get the structural parameters & define penalties
|
||||
%------------------------------------------------------------------------------
|
||||
|
||||
[fval,info,exit_flag,Model,Q,H]=check_bounds_and_definiteness_estimation(xparam1, Model, DynareOptions, EstimatedParameters, BoundsInfo);
|
||||
Model = set_all_parameters(xparam1,EstimatedParameters,Model);
|
||||
|
||||
[fval,info,exit_flag,Q,H]=check_bounds_and_definiteness_estimation(xparam1, Model, EstimatedParameters, BoundsInfo);
|
||||
if info(1)
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue