GSA sampling from prior range: replace infinity by huge number to avoid NaN

mr#2067
Johannes Pfeifer 2022-05-17 18:29:42 +02:00
parent 9f265c5b5b
commit b037bc9438
1 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,9 @@ if fload==0
end
if opt_gsa.prior_range
for j=1:np
lpmat(:,j)=lpmat(:,j).*(bounds.ub(j+nshock)-bounds.lb(j+nshock))+bounds.lb(j+nshock);
lower_bound=max(-options_.huge_number,bounds.lb(j+nshock));
upper_bound=min(options_.huge_number,bounds.ub(j+nshock));
lpmat(:,j)=lpmat(:,j).*(upper_bound-lower_bound)+lower_bound;
end
else
xx=prior_draw_gsa(0,[lpmat0 lpmat]);