160 likes | 474 Views
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/. Download DACE Toolbox (2/2). Command and Parameter (1/5). Command >> [ dmodel,perf ] = dacefit (S,Y,regr,corr,theta0)
E N D
Usage Of DACE Toolbox Lien-Chi Lai, Optimization Lab2009/10/09
Download DACE Toolbox (1/2) • DACE website: http://www2.imm.dtu.dk/~hbn/dace/ Usage of DACE Toolbox
Download DACE Toolbox (2/2) Usage of DACE Toolbox
Command and Parameter (1/5) • Command • >> [dmodel,perf] = dacefit(S,Y,regr,corr,theta0) • >> pred = predictor(x, dmodel) • Parameter • S experimental points (m-by-n) • Y responses at S(m-by-1) • regrregression function • corrcorrelation function • theta0 parameter of correlation function (1-by-1 if all dimensions are identical, or n-by-1) • x ptrial points with n dimensions (p-by-n) • predpredicted responses (p-by-1) Usage of DACE Toolbox
Command and Parameter (2/5) • Command • >> [dmodel,perf] = ... dacefit(S,Y,regr,corr,theta0,lob,upb) • >> pred = predictor(x, dmodel) • Parameter • lob,upboptional parameter, if present, then should be vectors of the same length astheta0 dim. should be same as the one of theta0 Usage of DACE Toolbox
Command and Parameter (3/5) • Command • >> [dmodel,perf] = ... dacefit(S,Y,regr,corr,theta0,lob,upb) • >> pred = predictor(x, dmodel) • Parameter • dmodelDACE model, struct with regr, corr, theta, beta … • perfinformation about the optimization, struct with nv,… Usage of DACE Toolbox
Command and Parameter (4/5) • Regression Models • regpoly0 Zero order polynomial • regpoly1 First order polynomial • regpoly2 Second order polynomial • Correlation Models • correxp Exponential • correxpg Generalized exponential • corrgauss Gaussian • corrlin Linear • corrspherical Spherical • corrspline Cubic spline Usage of DACE Toolbox
Command and Parameter (5/5) • Command • >> 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
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); Usage of DACE Toolbox
Example • Complete code for Branin function Usage of DACE Toolbox
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); Usage of DACE Toolbox
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; Usage of DACE Toolbox