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
generatesk - 1
start points as if using aRandomStartPointSet
object and theproblem
structure.MultiStart
also uses thex0
start point from theproblem
structure, for a total ofk
start points.Pass a
RandomStartPointSet
object.Pass a
CustomStartPointSet
object.Pass a cell array of
RandomStartPointSet
andCustomStartPointSet
objects. Pass a cell array if you have some specific points you want to run, but also wantMultiStart
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 Filter Start Points (Optional).
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 RandomStartPointSet
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 ofArtificialBound
.If a component has a lower bound
lb
but no upper bound,RandomStartPointSet
uses an upper bound oflb + 2*ArtificialBound
.Similarly, if a component has an upper bound
ub
but no lower bound,RandomStartPointSet
uses a lower bound ofub - 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
list
.
CustomStartPointSet Object for Start Points
To use a specific set of starting points, put the points in a CustomStartPointSet
as follows:
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 theStartPointsToRun
property. For more information, see MultiStart Algorithm.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 list
:
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);