Merge pull request #1218 from rattoma/gsa
Allow Screening with neighborhood_width sampling.time-shift
commit
3ae44efbea
|
@ -33,8 +33,12 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
pnames = M_.param_names(estim_params_.param_vals(:,1),:);
|
pnames = M_.param_names(estim_params_.param_vals(:,1),:);
|
||||||
|
if opt_gsa.pprior,
|
||||||
|
|
||||||
filetoload=[OutputDirectoryName '/' fname_ '_prior'];
|
filetoload=[OutputDirectoryName '/' fname_ '_prior'];
|
||||||
|
else
|
||||||
|
filetoload=[OutputDirectoryName '/' fname_ '_mc'];
|
||||||
|
end
|
||||||
load(filetoload,'lpmat','lpmat0','istable','T','yys','nspred','nboth','nfwrd')
|
load(filetoload,'lpmat','lpmat0','istable','T','yys','nspred','nboth','nfwrd')
|
||||||
if ~isempty(lpmat0),
|
if ~isempty(lpmat0),
|
||||||
lpmatx=lpmat0(istable,:);
|
lpmatx=lpmat0(istable,:);
|
||||||
|
|
|
@ -265,14 +265,22 @@ if fload==0,
|
||||||
end
|
end
|
||||||
if neighborhood_width>0,
|
if neighborhood_width>0,
|
||||||
for j=1:nshock,
|
for j=1:nshock,
|
||||||
lpmat0(:,j) = randperm(Nsam)'./(Nsam+1); %latin hypercube
|
if opt_gsa.morris ~= 1
|
||||||
|
lpmat0(:,j) = randperm(Nsam)'./(Nsam+1); %latin hypercube
|
||||||
|
end
|
||||||
ub=min([bounds.ub(j) xparam1(j)*(1+neighborhood_width)]);
|
ub=min([bounds.ub(j) xparam1(j)*(1+neighborhood_width)]);
|
||||||
lb=max([bounds.lb(j) xparam1(j)*(1-neighborhood_width)]);
|
lb=max([bounds.lb(j) xparam1(j)*(1-neighborhood_width)]);
|
||||||
lpmat0(:,j)=lpmat0(:,j).*(ub-lb)+lb;
|
lpmat0(:,j)=lpmat0(:,j).*(ub-lb)+lb;
|
||||||
end
|
end
|
||||||
for j=1:np,
|
for j=1:np,
|
||||||
ub=min([bounds.ub(j+nshock) xparam1(j+nshock)*(1+neighborhood_width)]);
|
ub=xparam1(j+nshock)*(1+sign(xparam1(j+nshock))*neighborhood_width);
|
||||||
lb=max([bounds.lb(j+nshock) xparam1(j+nshock)*(1-neighborhood_width)]);
|
lb=xparam1(j+nshock)*(1-sign(xparam1(j+nshock))*neighborhood_width);
|
||||||
|
if bounds.ub(j+nshock)>=xparam1(j) && bounds.lb(j)<=xparam1(j+nshock),
|
||||||
|
ub=min([bounds.ub(j+nshock) ub]);
|
||||||
|
lb=max([bounds.lb(j+nshock) lb]);
|
||||||
|
else
|
||||||
|
fprintf('\nstab_map_:: the calibrated value of param %s for neighborhood_width sampling is outside prior bounds.\nWe allow violation of bounds for this parameter, but if this was not done on purpose, please change calibration before running neighborhood_width sampling\n', bayestopt_.name{j+nshock})
|
||||||
|
end
|
||||||
lpmat(:,j)=lpmat(:,j).*(ub-lb)+lb;
|
lpmat(:,j)=lpmat(:,j).*(ub-lb)+lb;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -480,7 +488,7 @@ else
|
||||||
end
|
end
|
||||||
load(filetoload,'lpmat','lpmat0','irestriction','iunstable','istable','iindeterm','iwrong','ixun','egg','yys','nspred','nboth','nfwrd','infox')
|
load(filetoload,'lpmat','lpmat0','irestriction','iunstable','istable','iindeterm','iwrong','ixun','egg','yys','nspred','nboth','nfwrd','infox')
|
||||||
Nsam = size(lpmat,1);
|
Nsam = size(lpmat,1);
|
||||||
if pprior==0,
|
if pprior==0 && ~isempty(options_.mode_file),
|
||||||
eval(['load ' options_.mode_file '.mat;']);
|
eval(['load ' options_.mode_file '.mat;']);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue