using isequal while testing options_.mode_compute
parent
2de9113889
commit
50c085e5a3
|
@ -54,14 +54,14 @@ end
|
|||
%------------------------------------------------------------------------------
|
||||
% 1. Get the structural parameters & define penalties
|
||||
%------------------------------------------------------------------------------
|
||||
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
|
||||
k = find(xparam1 < bayestopt_.lb);
|
||||
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
||||
cost_flag = 0;
|
||||
info = 41;
|
||||
return;
|
||||
end
|
||||
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
|
||||
k = find(xparam1 > bayestopt_.ub);
|
||||
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
||||
cost_flag = 0;
|
||||
|
|
|
@ -48,14 +48,14 @@ llik=NaN;
|
|||
%------------------------------------------------------------------------------
|
||||
% 1. Get the structural parameters & define penalties
|
||||
%------------------------------------------------------------------------------
|
||||
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
|
||||
k = find(xparam1 < bayestopt_.lb);
|
||||
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
||||
cost_flag = 0;
|
||||
info = 41;
|
||||
return;
|
||||
end
|
||||
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
|
||||
k = find(xparam1 > bayestopt_.ub);
|
||||
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
||||
cost_flag = 0;
|
||||
|
|
|
@ -59,7 +59,7 @@ mXX = evalin('base', 'mXX');
|
|||
fval = [];
|
||||
cost_flag = 1;
|
||||
|
||||
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
|
||||
k = find(xparam1 < bayestopt_.lb);
|
||||
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
||||
cost_flag = 0;
|
||||
|
@ -67,7 +67,7 @@ if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
|
|||
return;
|
||||
end
|
||||
|
||||
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
|
||||
if ~isequal(options_.mode_compute,11) && any(xparam1 > bayestopt_.ub)
|
||||
k = find(xparam1 > bayestopt_.ub);
|
||||
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
||||
cost_flag = 0;
|
||||
|
|
|
@ -47,14 +47,14 @@ nobs = size(options_.varobs,1);
|
|||
%------------------------------------------------------------------------------
|
||||
% 1. Get the structural parameters & define penalties
|
||||
%------------------------------------------------------------------------------
|
||||
if options_.mode_compute ~= 1 && any(xparam1 < bayestopt_.lb)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 < bayestopt_.lb)
|
||||
k = find(xparam1 < bayestopt_.lb);
|
||||
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
||||
cost_flag = 0;
|
||||
info = 41;
|
||||
return;
|
||||
end
|
||||
if options_.mode_compute ~= 1 && any(xparam1 > bayestopt_.ub)
|
||||
if ~isequal(options_.mode_compute,1) && any(xparam1 > bayestopt_.ub)
|
||||
k = find(xparam1 > bayestopt_.ub);
|
||||
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
||||
cost_flag = 0;
|
||||
|
|
Loading…
Reference in New Issue