set start points for multistart -凯发k8网页登录

main content

set start points for multistart

four ways to set start points

there are four ways you tell multistart which start points to use for the local solver:

  • pass a positive integer k. multistart generates k - 1 start points as if using a randomstartpointset object and the problem structure. multistart also uses the x0 start point from the problem structure, for a total of k start points.

  • pass a randomstartpointset object.

  • pass a customstartpointset object.

  • pass a cell array of randomstartpointset and customstartpointset objects. pass a cell array if you have some specific points you want to run, but also want multistart to use other random start points.

note

you can control whether multistart uses all start points, or only those points that satisfy bounds or other inequality constraints. for more information, see .

positive integer for start points

the syntax for running multistart for k start points is

[xmin,fmin,flag,outpt,allmins] = run(ms,problem,k);

the positive integer k specifies the number of start points multistart uses. multistart generates random start points using the dimension of the problem and bounds from the problem structure. multistart generates k - 1 random start points, and also uses the x0 start point from the problem structure.

randomstartpointset object for start points

create a object as follows:

stpoints = randomstartpointset;

run multistart starting from a randomstartpointset as follows:

[xmin,fmin,flag,outpt,allmins] = run(ms,problem,stpoints);

by default a randomstartpointset object generates 10 start points. control the number of start points with the numstartpoints property. for example, to generate 40 start points:

stpoints = randomstartpointset('numstartpoints',40);

you can set an artificialbound for a randomstartpointset. this artificialbound works in conjunction with the bounds from the problem structure:

  • if a component has no bounds, randomstartpointset uses a lower bound of -artificialbound, and an upper bound of artificialbound.

  • if a component has a lower bound lb but no upper bound, randomstartpointset uses an upper bound of lb   2*artificialbound.

  • similarly, if a component has an upper bound ub but no lower bound, randomstartpointset uses a lower bound of ub - 2*artificialbound.

for example, to generate 100 start points with an artificialbound of 50:

stpoints = randomstartpointset('numstartpoints',100, ...
    'artificialbound',50);

a randomstartpointset object generates start points with the same dimension as the x0 point in the problem structure; see .

customstartpointset object for start points

to use a specific set of starting points, package them in a as follows:

  1. place the starting points in a matrix. each row of the matrix represents one starting point. multistart runs all the rows of the matrix, subject to filtering with the startpointstorun property. for more information, see .

  2. create a customstartpointset object from the matrix:

    tpoints = customstartpointset(ptmatrix);

for example, create a set of 40 five-dimensional points, with each component of a point equal to 10 plus an exponentially distributed variable with mean 25:

pts = -25*log(rand(40,5))   10;
tpoints = customstartpointset(pts);

run multistart starting from a customstartpointset as follows:

[xmin,fmin,flag,outpt,allmins] = run(ms,problem,tpoints);

to get the original matrix of points from a customstartpointset object, use :

pts = list(tpoints); % assumes tpoints is a customstartpointset

a customstartpointset has two properties: startpointsdimension and numstartpoints. you can use these properties to query a customstartpointset object. for example, the tpoints object in the example has the following properties:

tpoints.startpointsdimension
ans =
     5
tpoints.numstartpoints
ans =
    40

cell array of objects for start points

to use a specific set of starting points along with some randomly generated points, pass a cell array of randomstartpointset or customstartpointset objects.

for example, to use both the 40 specific five-dimensional points of customstartpointset object for start points and 40 additional five-dimensional points from randomstartpointset:

pts = -25*log(rand(40,5))   10;
tpoints = customstartpointset(pts);
rpts = randomstartpointset('numstartpoints',40);
allpts = {tpoints,rpts};

run multistart starting from the allpts cell array:

% assume ms and problem exist
[xmin,fmin,flag,outpt,allmins] = run(ms,problem,allpts);

related topics

    网站地图