-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscreeningplot.m
60 lines (52 loc) · 1.86 KB
/
screeningplot.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function screening_plot(X, Objhandle, Range, xi, p, Labels)
% Generates a variable elementary effect screening plot
%
% Inputs:
% X - screening plan built within a [0,1]^k box (e.g. with
% screening_plan.m)
% Objhandle - name of the objective function
% Range - 2xk matrix (k - number of design variables) of lower bounds
% (first row) and upper bounds (second row) on each variable.
% xi- elementery effect step length factor
% p - number of discreet levels along each dimension
% Labels - 1xk cell array containing the names of the variables
%
% Copyright 2007 A Sobester
%
% This program is free software: you can redistribute it and/or modify it
% under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or any
% later version.
%
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License and GNU
% Lesser General Public License along with this program. If not, see
% <http://www.gnu.org/licenses/>.
k = size(X,2);
r = size(X,1)/(k+1);
for i=1:size(X,1)
X(i,:) = Range(1,:) + X(i,:).*(Range(2,:)-Range(1,:));
t(i) = feval(Objhandle,X(i,:));
end
for i=1:r
for j = (i-1)*(k+1)+1:(i-1)*(k+1)+k
F(find(X(j,:)-X(j+1,:)~=0),i) = (t(j+1)-t(j))/(xi/(p-1));
end
end
% Compute statistical measures
for i=1:k
ssd(i) = std(F(i,:));
sm(i) = mean(F(i,:));
end
figure, hold on
for i=1:k
text(sm(i),ssd(i),Labels(i),'FontSize',25)
end
axis([min(sm) max(sm) min(ssd) max(ssd)]);
xlabel('Sample means')
ylabel('Sample standard deviations')
set(gca,'FontSize',14)