CGO expDesign
From TomWiki
This page is part of the CGO Manual. See CGO Manual. |
Contents |
Purpose
Computes an initial experimental design for CGO solvers. Note that expDesign should not be called directly, since all inputs are assumed to be correct and no error-checking is done. For direct calls, use expDesignD instead with the same input/output.
Calling syntax
[X, O, F, Fpen, F00, Cc, Cn, nCon, nSample, ExDText, initRS] = expDesign(Percent, nSample, AddMP, nTrial, CLHMethod, SCALE, RandState, PriLev, Prob, varargin)
Description of inputs
Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Percent | Type of strategy to get the initial sampled values.
Negative values of Percent result in constrained versions of the experimental design methods 7-16. It means that all points sampled are feasible with respect to all given constraints. For ExD 5,6-12,14-16 user defined points are used. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nSample | Number of sample points to be used in initial experimental design. nSample is used differently depending on Percent:
where LATIN = [21 21 33 41 51 65 65] and k = |nSample|. Otherwise nSample as input does not matter. Description of the experimental designs: ExD 1, All Corners. Initial points is the corner points of the box given by Prob.x_L and Prob.x_U. Generates 2^{d} points, which results in too many points when the dimension is high. ExD 2, Lower and Upper Corner point + adjacent points. Initial points are 2 * d + 2 corners: the lower left corner x_{L} and its d adjacent corners x_{L} + (x_{Ui} - x_{Li} * e_{i}, i = 1, ..., d and the upper right corner x_{U} and its d adjacent corners x_{U} - (x_{Ui} - x_{Li} * e_{i}, i = 1, ..., d ExD 3. Initial points are the upper right corner x_{U} and its d adjacent corners x_{U} - (x_{Ui} - x_{Li} * e_{i} , i = 1, ..., d ExD 4. Initial points are the lower left corner x_{L} and its d adjacent corners x_{L} + (x_{Ui} - x_{Li} * e_{i} , i = 1, ..., d ExD 5. User given initial points, given as a matrix in CGO.X. Each column is one sampled point. If d = length(Prob.x_L), then size(X,1) = d, size(X,2) >= d + 1. CGO.F should be defined as empty, or contain a vector of corresponding f (x) values. Any CGO.F value set as NaN will be computed by solver routine. ExD 6. Use determinstic global optimization methods to find the initial design. Current methods available (all DIRECT methods), dependent on the value of Percent:
If a DIRECT solver already computed the needed points, the warm start file (e.g. glcDirectSave.mat for glcDirect) or the warm start structure in Result."solvername".WarmStartInfo is given in input field CGO.glXFile. ExD 7-11. Optimal Latin Hypercube Designs (LHD) with respect to different norms. The following norms and designs are available:
All designs taken from: http://www.spacefillingdesigns.nl/ Constrained versions will try bigger and bigger designs up to M = max(10 * d, nTrial) different designs, stopping when it has found nSample feasible points. ExD 12. Latin hypercube space-filling design. For nSample < 0, k = |nSample| should in principle be the problem dimension. The number of points sampled is:
k : 2 3 4 5 6 > 6 Points : 21 33 41 51 65 65 The call made is:
Set
This is a more efficient number of points to use. If CGO.X is nonempty, these points are verified as in ExD 5, and treated as already sampled points. Then nSample additional points are sampled, restricted to be close to the given points. Constrained version of Latin hypercube only keep points that fulfill the linear and nonlinear constraints. The algorithm will try up to M = max(10 * d, nTrial) points, stopping when it has found nSample feasible points (d + 1 points if nSample < 0). For pure integer programming (IP) problems with 1 or more linear equalities, a special function mipFeasible generates part of the design solving a set of LP problems. At least as many infeasible points as number of linear equalities are sampled, which is necessary. ExD 13. Orthogonal Sampling, LH with subspace density demands. ExD 14,15 and 16. Random strategies, the |Percent| value gives the percentage size of an ellipsoid, circle or rectangle around the so far sampled points that new points are not allowed in. Range 1%-50%. Recommended values 10% - 20%. If CGO.X is nonempty, these points are verified as in ExD 5, and treated as already sampled points. Then nSample additional points are sampled, restricted to be close to the given points. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AddMP | If = 1, add the midpoint as extra point in the corner strategies. Default AddMP=1 if any corner strategy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nTrial | For CLH, the method generates M = max(10 * d, nTrial) trial points, and evaluates them until nSample feasible points are found.
In the random designs, nTrial is the maximum number of trial points randomly generated for each new point to sample. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CLHMethod | Different search strategies for finding feasible LH points. First of all, the least infeasible point is added. Then the linear feasible points are considered. If more points are needed still, the nonlinear infeasible points are added.
1 - Take the sampled infeasible points in order. 2 - Take a random sample of the infeasible points. 3 - Use points with lowest constraint error (cErr). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SCALE | 0 - Original search space.
1 - Transform search space to unit cube. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RandState | If >= 0, rand('state',RandState) is set to initialize the pseudo-random generator.
If < 0, rand('state', 100*clock) is set to give a new set of random values each run. If isnan(RandState), the random state is not initialized.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PriLev | Print Level, if > 0 print 1 line information, if >1 more info. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prob | Problem structure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields used in Prob: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
x_L | Lower bounds for each element in x. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
x_U | Lower bounds for each element in x. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
b_L | Lower bounds for the linear constraints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
b_U | Upper bounds for the linear constraints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A | Linear constraint matrix | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
c_L | Lower bounds for the nonlinear constraints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
c_U | Upper bounds for the nonlinear constraints. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optParam | Structure which defines optimization parameters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields used in Prob.optParam: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bTol | Linear constraint tolerance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cTol | Nonlinear constraint tolerance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CGO | Defines user given points. Could also contain function values.
If ExD == 12, 14-16 these points are included into the design. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields used in Prob.CGO: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
X | A matrix of initial x values. One column for every x value.
If ExD = 5, size(X,2) >= dim(x)+1 needed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
F | A vector of initial f(x) values. If any element is set to NaN it will be computed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cc | Optionally a matrix of costly nonlinear constraint values Cc(x).
Each column Cc(:,i) is the constraint evaluated for x = X(:,i); If nonempty, then size(Cc,2) == size(X,2) must hold. If any element in column i is NaN, the vector Cc_i(x) = Cc(:,i) will be recomputed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
glxFile | Name of DIRECT solver warm start file or warm start structure. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
varargin | Additional parameters that are sent to the costly f(x). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MIP | Defines integer optimization parameters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields used in Prob.MIP: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntVars | Index vector with indices for integer variables. |
Description of outputs
Name | Description |
---|---|
X | Matrix with sampled points (in unit space if SCALE == 1). |
O | Matrix with sampled points (in original space). |
F | Vector with function values (penalty added for costly Cc(x)). |
Fpen | Vector with function values + additional penalty if infeasible using the linear constraints and noncostly nonlinear c(x). |
F00 | Vector of pure function values, before penalties. |
Cc | Matrix with costly constraint values, Cc(x) |
nCon | Number of noncostly constraint evaluations calling Cn(x). |
nSample | Corrected value of nSample. |
ExDText | String with experimental design information. |
initRS | State of random number generator immidiately after initialization. If no initialization is done, its current value is saved instead. |