-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInfill_pseudo_EIM_Hypervolume.m
45 lines (45 loc) · 1.88 KB
/
Infill_pseudo_EIM_Hypervolume.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function obj = Infill_Pseudo_EIM_Hypervolume(x, kriging_obj, f, point_added)
% the criterion is going to be evaluated a large amount of times, so efficiency is very important
%-----------------------------------------------------
% number of objectives
[num_pareto,num_obj] = size(f);
% number of input designs
num_x = size(x,1);
y = zeros(num_x,1);
% the reference point
r = 1.1*ones(1, num_obj);
%-----------------------------------------------------
% the kriging prediction and varince
u = zeros(num_x,num_obj);
mse = zeros(num_x,num_obj);
for ii = 1:num_obj
[u(:, ii),mse(:, ii)] = predictor(x, kriging_obj{ii});
end
s = sqrt(max(0,mse));
%-----------------------------------------------------
r_matrix = repmat(r,num_pareto,1);
for ii = 1 : num_x
u_matrix = repmat(u(ii,:),num_pareto,1);
s_matrix = repmat(s(ii,:),num_pareto,1);
EIM = (f - u_matrix).*Gaussian_CDF((f - u_matrix)./s_matrix) + s_matrix.*Gaussian_PDF((f - u_matrix)./s_matrix);
% if this is the first infill point
if ~isempty(point_added)
num_added = size(point_added,1);
correlation = zeros(num_added, num_obj);
% the scaling of x is the same for different objectives
scaled_x = (x(ii,:) - kriging_obj{1}.Ssc(1,:)) ./ kriging_obj{1}.Ssc(2,:);
scaled_point_added = (point_added - repmat(kriging_obj{1}.Ssc(1,:),size(point_added,1),1)) ./ repmat(kriging_obj{1}.Ssc(2,:),size(point_added,1),1);
dx = repmat(scaled_x,num_added,1) - scaled_point_added;
% calculate the correlation
for jj = 1:num_obj
correlation(:,jj) = feval(kriging_obj{jj}.corr, kriging_obj{jj}.theta, dx);
end
% the Pseudo EI matrix
EIM = EIM.*repmat(prod(1-correlation,1),num_pareto,1);
end
y(ii) = min(prod(r_matrix - f + EIM,2) - prod(r_matrix - f,2));
end
%-----------------------------------------------------
% the objective is maximized
obj = -y;
end