Transcript 投影片 1

Usage Of DACE Toolbox
Lien-Chi Lai, Optimization Lab
2009/10/09
Download DACE Toolbox (1/2)
DACE website: http://www2.imm.dtu.dk/~hbn/dace/

2
Usage of DACE Toolbox
Download DACE Toolbox
Download DACE Toolbox (2/2)
3
Usage of DACE Toolbox
Download DACE Toolbox
Command and Parameter (1/5)
Command



>> [dmodel,perf] = dacefit(S,Y,regr,corr,theta0)
>> pred = predictor(x, dmodel)
Parameter








4
S
Y
regr
corr
theta0
x
pred
experimental points (m-by-n)
responses at S (m-by-1)
regression function
correlation function
parameter of correlation function
(1-by-1 if all dimensions are identical, or n-by-1)
p trial points with n dimensions (p-by-n)
predicted responses (p-by-1)
Usage of DACE Toolbox
Command and Parameter
Command and Parameter (2/5)
Command



>> [dmodel,perf] = ...
dacefit(S,Y,regr,corr,theta0,lob,upb)
>> pred = predictor(x, dmodel)
Parameter


5
lob,upb optional parameter, if present, then should be
vectors of the same length as theta0
dim. should be same as the one of theta0
Usage of DACE Toolbox
Command and Parameter
Command and Parameter (3/5)
Command
 >> [dmodel,perf] = ...
dacefit(S,Y,regr,corr,theta0,lob,upb)
 >> pred = predictor(x, dmodel)
Parameter
 dmodel DACE model, struct with regr, corr,
theta, beta …
 perf
information about the optimization, struct
with nv, …


6
Usage of DACE Toolbox
Command and Parameter
Command and Parameter (4/5)
Regression Models




regpoly0 Zero order polynomial
regpoly1 First order polynomial
regpoly2 Second order polynomial
Correlation Models







7
correxp
correxpg
corrgauss
corrlin
corrspherical
corrspline
Exponential
Generalized exponential
Gaussian
Linear
Spherical
Cubic spline
Usage of DACE Toolbox
Command and Parameter
Command and Parameter (5/5)
Command


8
>> x = gridsamp([1 1;3 3], 3)
x =
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
Usage of DACE Toolbox
Command and Parameter
Example
>> [dmodel, perf] = dacefit(S, Y, @regpoly0, ...
@corrgauss, 10);
>> [dmodel, perf] = dacefit(S, Y, @regpoly0, ...
@corrgauss, 10, 0.1, 20);
>> [dmodel, perf] = dacefit(S, Y, @regpoly0, ...
@corrgauss, [10 10], ...
[0.1 0.1], [20 20]);
>> pred = predictor(x, dmodel);




9
Usage of DACE Toolbox
Example
Example

Complete code for Branin function
10
Usage of DACE Toolbox
Example
Appendix – Complete Code (1/2)
% S = lhsamp(25,2);
load S.mat
S = [S(:,1)*15-5, S(:,2)*15];
Y = ft_branin(S(:,1), S(:,2));
x = gridsamp([-5 0;10 15], 25);
theta = [10 10];
lob = [1e-1 1e-1];
upb = [20 20];
[dmodel, perf] = dacefit(S, Y, @regpoly0, ...
@corrgauss, theta, lob, upb);
% [dmodel, perf] = dacefit(S, Y, @regpoly0, ...
@corrgauss, 1);
pred = predictor(x, dmodel);
11
Usage of DACE Toolbox
Appendix – Complete Code
Appendix – Complete Code (1/2)
[x_grid, y_grid] = meshgrid(-5:15/24:10, 0:15/24:15);
surf(x_grid, y_grid, reshape(pred, 25, 25));
view(2); xlabel('x'); ylabel('y');
title('Surrogate Surface');
% final_theta = dmodel.theta;
% function z = ft_branin(x, y)
% z = (y - 5.1*x.^2/(4*pi*pi) + 5*x/pi -6).^2 + ...
10*(1-1/(8*pi))*cos(x) + 10;
12
Usage of DACE Toolbox
Appendix – Complete Code