NAG Library Routine Document
e05jbf
(bnd_mcs_solve)
Note: this routine uses optional parameters to define choices in the problem specification and in the details of the algorithm. If you wish to use default
settings for all of the optional parameters, you need only read Sections 1 to 10 of this document. If, however, you wish to reset some or all of the settings please refer to Section 11 for a detailed description of the algorithm, and to Section 12 for a detailed description of the specification of the optional parameters.
1
Purpose
e05jbf is designed to find the global minimum or maximum of an arbitrary function, subject to simple bound-constraints using a multi-level coordinate search method. Derivatives are not required, but convergence is only guaranteed if the objective function is continuous in a neighbourhood of a global optimum. It is not intended for large problems.
The initialization routine
e05jaf must have been called before calling
e05jbf.
2
Specification
Fortran Interface
Subroutine e05jbf ( |
n,
objfun,
ibound,
iinit,
bl,
bu,
sdlist,
list,
numpts,
initpt,
monit,
x,
obj,
comm,
lcomm,
iuser,
ruser,
ifail) |
Integer, Intent (In) | :: |
n,
ibound,
iinit,
sdlist,
lcomm | Integer, Intent (Inout) | :: |
numpts(n),
initpt(n),
iuser(*),
ifail | Real (Kind=nag_wp), Intent (Inout) | :: |
bl(n),
bu(n),
list(n,sdlist),
comm(lcomm),
ruser(*) | Real (Kind=nag_wp), Intent (Out) | :: |
x(n),
obj | External | :: |
objfun,
monit |
|
C Header Interface
#include nagmk26.h
void |
e05jbf_ (
const Integer *n,
void (NAG_CALL *objfun)(
const Integer *n,
const double x[],
double *f,
const Integer *nstate,
Integer iuser[],
double ruser[],
Integer *inform),
const Integer *ibound,
const Integer *iinit,
double bl[],
double bu[],
const Integer *sdlist,
double list[],
Integer numpts[],
Integer initpt[],
void (NAG_CALL *monit)(
const Integer *n,
const Integer *ncall,
const double xbest[],
const Integer icount[],
const Integer *ninit,
const double list[],
const Integer numpts[],
const Integer initpt[],
const Integer *nbaskt,
const double xbaskt[],
const double boxl[],
const double boxu[],
const Integer *nstate,
Integer iuser[],
double ruser[],
Integer *inform),
double x[],
double *obj,
double comm[],
const Integer *lcomm,
Integer iuser[],
double ruser[],
Integer *ifail) |
|
e05jaf must be called before calling
e05jbf, or any of the option-setting or option-getting
routines
e05jcf,
e05jdf,
e05jef,
e05jff,
e05jgf,
e05jhf,
e05jjf,
e05jkf or
e05jlf.
You
must not alter the number of non-fixed variables in your problem or the contents of
the array
comm
between calls of the
routines
e05jaf,
e05jbf,
e05jcf,
e05jdf,
e05jef,
e05jff,
e05jgf,
e05jhf,
e05jjf,
e05jkf or
e05jlf.
3
Description
e05jbf is designed to solve modestly sized global optimization problems having simple bound-constraints only; it finds the global optimum of a nonlinear function subject to a set of bound constraints on the variables. Without loss of generality, the problem is assumed to be stated in the following form:
where
(the
objective function) is a nonlinear scalar function (assumed to be continuous in a neighbourhood of a global minimum), and the bound vectors are elements of
, where
denotes the extended reals
. Relational operators between vectors are interpreted elementwise.
The optional parameter
Maximize should be set if you wish to solve maximization, rather than minimization, problems.
If certain bounds are not present, the associated elements of
or
can be set to special values that will be treated as
or
. See the description of the optional parameter
Infinite Bound Size. Phrases in this document containing terms like ‘unbounded values’ should be understood to be taken relative to this optional parameter.
Fixing variables (that is, setting for some ) is allowed in e05jbf.
A typical excerpt from a routine calling
e05jbf is:
Call e05jaf (n_r, comm, lcomm, ...)
Call e05jdf (optstr, comm, lcomm, ...)
Call e05jbf (n, objfun, ...)
where
e05jdf sets the optional parameter and value specified in
optstr.
The initialization routine
e05jaf does not need to be called before each invocation of
e05jbf. You should be aware that a call to the initialization routine will reset each optional parameter to its default value, and, if you are using repeatable randomized initialization lists (see the description of the argument
iinit), the random state stored in
the array
comm
will be destroyed.
You must supply a subroutine that evaluates ; derivatives are not required.
The method used by
e05jbf is based on MCS, the Multi-level Coordinate Search method described in
Huyer and Neumaier (1999), and the algorithm it uses is described in detail in
Section 11.
4
References
Huyer W and Neumaier A (1999) Global optimization by multi-level coordinate search Journal of Global Optimization 14 331–355
5
Arguments
- 1: – IntegerInput
-
On entry: , the number of variables.
Constraint:
.
- 2: – Subroutine, supplied by the user.External Procedure
-
objfun must evaluate the objective function
for a specified
-vector
.
The specification of
objfun is:
Fortran Interface
Integer, Intent (In) | :: |
n,
nstate | Integer, Intent (Inout) | :: |
iuser(*) | Integer, Intent (Out) | :: |
inform | Real (Kind=nag_wp), Intent (In) | :: |
x(n) | Real (Kind=nag_wp), Intent (Inout) | :: |
ruser(*) | Real (Kind=nag_wp), Intent (Out) | :: |
f |
|
C Header Interface
#include nagmk26.h
void |
objfun (
const Integer *n,
const double x[],
double *f,
const Integer *nstate,
Integer iuser[],
double ruser[],
Integer *inform) |
|
- 1: – IntegerInput
-
On entry: , the number of variables.
- 2: – Real (Kind=nag_wp) arrayInput
-
On entry: , the vector at which the objective function is to be evaluated.
- 3: – Real (Kind=nag_wp)Output
-
On exit: must be set to the value of the objective function at
, unless you have specified termination of the current problem using
inform.
- 4: – IntegerInput
-
On entry: if
then
e05jbf is calling
objfun for the first time. This argument setting allows you to save computation time if certain data must be read or calculated only once.
- 5: – Integer arrayUser Workspace
- 6: – Real (Kind=nag_wp) arrayUser Workspace
-
objfun is called with the arguments
iuser and
ruser as supplied to
e05jbf. You should use the arrays
iuser and
ruser to supply information to
objfun.
- 7: – IntegerOutput
-
On exit: must be set to a value describing the action to be taken by the solver on return from
objfun. Specifically, if the value is negative the solution of the current problem will terminate immediately; otherwise, computations will continue.
objfun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which
e05jbf is called. Arguments denoted as
Input must
not be changed by this procedure.
Note: objfun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
e05jbf. If your code inadvertently
does return any NaNs or infinities,
e05jbf is likely to produce unexpected results.
- 3: – IntegerInput
-
On entry: indicates whether the facility for dealing with bounds of special forms is to be used.
ibound must be set to one of the following values.
- You will supply and individually.
- There are no bounds on .
- There are semi-infinite bounds .
- There are constant bounds and .
Note that it only makes sense to fix any components of when .
Constraint:
, , or .
- 4: – IntegerInput
-
On entry: selects which initialization method to use.
- Simple initialization (boundary and midpoint), with
, and
,
for and .
- Simple initialization (off-boundary and midpoint), with
, and
,
for and .
- Initialization using linesearches.
- You are providing your own initialization list.
- Generate a random initialization list.
For more information on methods
,
or
see
Section 11.1.
If ‘infinite’ values (as determined by the value of the optional parameter
Infinite Bound Size) are detected by
e05jbf when you are using a simple initialization method (
or
), a safeguarded initialization procedure will be attempted, to avoid overflow.
Suggested value:
.
Constraint:
, , , or .
- 5: – Real (Kind=nag_wp) arrayInput/Output
- 6: – Real (Kind=nag_wp) arrayInput/Output
-
On entry:
is
, the array of lower bounds.
is
, the array of upper bounds.
If
, you must set
to
and
to
, for
. If a particular
is to be unbounded below, the corresponding
should be set to
, where
is the value of the optional parameter
Infinite Bound Size. Similarly, if a particular
is to be unbounded above, the corresponding
should be set to
.
If
or
, arrays
bl and
bu need not be set on input.
If
, you must set
to
and
to
. The remaining elements of
bl and
bu will then be populated by these initial values.
On exit: unless
or
on exit,
bl and
bu are the actual arrays of bounds used by
e05jbf.
Constraints:
- if , , for ;
- if , .
- 7: – IntegerInput
-
On entry: the second dimension of the array
list as declared in the (sub)program from which
e05jbf is called.
sdlist is, at least, the maximum over
of the number of points in coordinate
at which to split according to the initialization list
list; that is,
.
Internally,
e05jbf uses
list to determine sets of points along each coordinate direction to which it fits quadratic interpolants. Since fitting a quadratic requires at least three distinct points, this puts a lower bound on
sdlist. Furthermore, in the case of initialization by linesearches (
) internal storage considerations require that
sdlist be at least
, but not all of this space may be used.
Constraints:
- if , ;
- if , ;
- if , .
- 8: – Real (Kind=nag_wp) arrayInput/Output
-
On entry: this argument need not be set on entry if you wish to use one of the preset initialization methods (
).
list is the ‘initialization list’: whenever a sub-box in the algorithm is split for the first time (either during the
initialization procedure or later), for each non-fixed coordinate
the split is done at the values
, as well as at some adaptively chosen intermediate points. The array sections
, for
, must be in ascending order with each entry being distinct. In this context, ‘distinct’ should be taken to mean relative to the safe-range argument (see
x02amf).
On exit: unless
,
or
on exit, the actual initialization data used by
e05jbf. If you wish to monitor the contents of
list you are advised to do so solely through
monit, not through the output value here.
Constraint:
if is not fixed, is in ascending order with each entry being distinct, for , for and .
- 9: – Integer arrayInput/Output
-
On entry: this argument need not be set on entry if you wish to use one of the preset initialization methods (
).
numpts encodes the number of splitting points in each non-fixed dimension.
On exit: unless , or on exit, the actual initialization data used by e05jbf.
Constraints:
- if is not fixed, ;
- , for .
- 10: – Integer arrayInput/Output
-
On entry: this argument need not be set on entry if you wish to use one of the preset initialization methods (
).
You must designate a point stored in
list that you wish
e05jbf to consider as an ‘initial point’ for the purposes of the splitting procedure. Call this initial point
. The coordinates of
correspond to a set of indices
, for
, such that
is stored in
, for
. You must set
, for
.
On exit: unless , or on exit, the actual initialization data used by e05jbf.
Constraint:
if is not fixed, , for .
- 11: – Subroutine, supplied by the NAG Library or the user.External Procedure
-
monit may be used to monitor the optimization process. It is invoked upon every successful completion of the procedure in which a sub-box is considered for splitting. It will also be called just before
e05jbf exits if that splitting procedure was not successful.
If no monitoring is required,
monit may be
the dummy monitoring routine e05jbk supplied by the NAG Library.
The specification of
monit is:
Fortran Interface
Subroutine monit ( |
n,
ncall,
xbest,
icount,
ninit,
list,
numpts,
initpt,
nbaskt,
xbaskt,
boxl,
boxu,
nstate,
iuser,
ruser,
inform) |
Integer, Intent (In) | :: |
n,
ncall,
icount(6),
ninit,
numpts(n),
initpt(n),
nbaskt,
nstate | Integer, Intent (Inout) | :: |
iuser(*) | Integer, Intent (Out) | :: |
inform | Real (Kind=nag_wp), Intent (In) | :: |
xbest(n),
list(n,ninit),
xbaskt(n,nbaskt),
boxl(n),
boxu(n) | Real (Kind=nag_wp), Intent (Inout) | :: |
ruser(*) |
|
C Header Interface
#include nagmk26.h
void |
monit (
const Integer *n,
const Integer *ncall,
const double xbest[],
const Integer icount[],
const Integer *ninit,
const double list[],
const Integer numpts[],
const Integer initpt[],
const Integer *nbaskt,
const double xbaskt[],
const double boxl[],
const double boxu[],
const Integer *nstate,
Integer iuser[],
double ruser[],
Integer *inform) |
|
- 1: – IntegerInput
-
On entry: , the number of variables.
- 2: – IntegerInput
-
On entry: the cumulative number of calls to
objfun.
- 3: – Real (Kind=nag_wp) arrayInput
-
On entry: the current best point.
- 4: – Integer arrayInput
-
On entry: an array of counters.
- , the current number of sub-boxes.
- , the cumulative number of calls to objfun made in local searches.
- , the cumulative number of points used as start points for local searches.
- , the cumulative number of sweeps through levels.
- , the cumulative number of splits by initialization list.
- , the current lowest level containing non-split boxes.
- 5: – IntegerInput
-
On entry: the maximum over
of the number of points in coordinate
at which to split according to the initialization list
list. See also the description of the argument
numpts.
- 6: – Real (Kind=nag_wp) arrayInput
-
On entry: the initialization list.
- 7: – Integer arrayInput
-
On entry: the number of points in each coordinate at which to split according to the initialization list
list.
- 8: – Integer arrayInput
-
On entry: a pointer to the ‘initial point’ in
list. Element
is the column index in
list of the
th coordinate of the initial point.
- 9: – IntegerInput
-
On entry: the number of points in the ‘shopping basket’
xbaskt.
- 10: – Real (Kind=nag_wp) arrayInput
-
Note: the th candidate minimum has its th coordinate stored in
, for and .
On entry: the ‘shopping basket’ of candidate minima.
- 11: – Real (Kind=nag_wp) arrayInput
-
On entry: the array of lower bounds of the current search box.
- 12: – Real (Kind=nag_wp) arrayInput
-
On entry: the array of upper bounds of the current search box.
- 13: – IntegerInput
-
On entry: is set by
e05jbf to indicate at what stage of the minimization
monit was called.
- This is the first time that monit has been called.
- This is the last time monit will be called.
- This is the first and last time monit will be called.
- 14: – Integer arrayUser Workspace
- 15: – Real (Kind=nag_wp) arrayUser Workspace
-
monit is called with the arguments
iuser and
ruser as supplied to
e05jbf. You should use the arrays
iuser and
ruser to supply information to
monit.
- 16: – IntegerOutput
-
On exit: must be set to a value describing the action to be taken by the solver on return from
monit. Specifically, if the value is negative the solution of the current problem will terminate immediately; otherwise, computations will continue.
monit must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which
e05jbf is called. Arguments denoted as
Input must
not be changed by this procedure.
- 12: – Real (Kind=nag_wp) arrayOutput
-
On exit: if
, contains an estimate of the global optimum (see also
Section 7).
- 13: – Real (Kind=nag_wp)Output
-
On exit: if
, contains the function value at
x.
If you request early termination of
e05jbf using
inform in
objfun or the analogous
inform in
monit, there is no guarantee that the function value at
x equals
obj.
- 14: – Real (Kind=nag_wp) arrayCommunication Array
-
On exit:
comm must not be altered between calls to any of the routines
e05jbf,
e05jcf,
e05jdf,
e05jef,
e05jff,
e05jgf,
e05jhf,
e05jjf,
e05jkf and
e05jlf.
- 15: – IntegerInput
-
On entry: the dimension of the array
comm as declared in the (sub)program from which
e05jbf is called.
Constraint:
.
- 16: – Integer arrayUser Workspace
- 17: – Real (Kind=nag_wp) arrayUser Workspace
-
iuser and
ruser are not used by
e05jbf, but are passed directly to
objfun and
monit and may be used to pass information to these routines.
- 18: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
e05jbf returns with
if your termination criterion has been met: either a target value has been found to the required relative error (as determined by the values of the optional parameters
Target Objective Value,
Target Objective Error and
Target Objective Safeguard), or the best function value was static for the number of sweeps through levels given by the optional parameter
Static Limit. The latter criterion is the default.
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
Initialization routine
e05jaf has not been called.
On entry, .
Constraint: .
-
A value of
Splits Limit (
) smaller than
was set:
,
.
On entry, .
Constraint: , , or .
On entry, or and , and .
Constraint: if then , for ; if then .
On entry, and .
Constraint: if then .
On entry, .
Constraint: , , , or .
On entry, and .
Constraint: if then .
On entry, and .
Constraint: if then .
On entry, .
Constraint: .
On entry, user-supplied , .
Constraint: if is not fixed then , for .
On entry, user-supplied , and .
Constraint: if is not fixed then , for .
On entry, user-supplied , , , and .
Constraint: if is not fixed then , for and .
On entry, user-supplied , , , and .
Constraint: if is not fixed then , for and .
On entry, user-supplied , .
Constraint: if is not fixed then , for .
On entry, user-supplied , and .
Constraint: if is not fixed then , for .
On entry, user-supplied section contained distinct elements, and : , , .
On entry, user-supplied section was not in ascending order: , .
The number of non-fixed variables .
Constraint: .
-
A finite initialization list could not be computed internally. Consider reformulating the bounds on the problem, try providing your own initialization list, use the randomization option (
) or vary the value of
Infinite Bound Size.
The user-supplied initialization list contained infinite values, as determined by the optional parameter
Infinite Bound Size.
-
The division procedure completed but your target value could not be reached.
Despite every sub-box being processed
Splits Limit times, the target value you provided in
Target Objective Value could not be found to the tolerances given in
Target Objective Error and
Target Objective Safeguard. You could try reducing
Splits Limit or the objective tolerances.
-
The function evaluations limit was exceeded.
Approximately
Function Evaluations Limit function calls have been made without your chosen termination criterion being satisfied.
-
User-supplied monitoring routine requested termination.
User-supplied objective function requested termination.
-
An error occurred during initialization. It is likely that points from the initialization list are very close together. Try relaxing the bounds on the variables or use a different initialization method.
An error occurred during linesearching. It is likely that your objective function is badly scaled: try rescaling it. Also, try relaxing the bounds or use a different initialization method. If the problem persists, please contact
NAG quoting error code
.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
If
on exit, then the vector returned in the array
x is an estimate of the solution
whose function value satisfies your termination criterion: the function value was static for
Static Limit sweeps through levels, or
where
is the value of the optional parameter
Target Objective Value,
is the value of the optional parameter
Target Objective Error, and
is the value of the optional parameter
Target Objective Safeguard.
8
Parallelism and Performance
e05jbf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e05jbf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
For each invocation of
e05jbf, local workspace arrays of fixed length are allocated internally. The total size of these arrays amounts to
integer elements, where
is the value of the optional parameter
Splits Limit and
is the number of non-fixed variables, and
real elements. In addition, if you are using randomized initialization lists (see the description of the argument
iinit), a further
integer elements are allocated internally.
In order to keep track of the regions of the search space that have been visited while looking for a global optimum,
e05jbf internally allocates arrays of increasing sizes depending on the difficulty of the problem. Two of the main factors that govern the amount allocated are the number of sub-boxes (call this quantity
) and the number of points in the ‘shopping basket’ (the argument
nbaskt on entry to
monit). Safe, pessimistic upper bounds on these two quantities are so large as to be impractical. In fact, the worst-case number of sub-boxes for even the most simple initialization list (when
on entry to
monit) grows like
. Thus
e05jbf does not attempt to estimate in advance the final values of
or
nbaskt for a given problem. There are a total of
integer arrays and
real arrays whose lengths depend on
, and there are a total of
integer arrays and
real arrays whose lengths depend on
nbaskt.
e05jbf makes a fixed initial guess that the maximum number of sub-boxes required will be
and that the maximum number of points in the ‘shopping basket’ will be
. If ever a greater amount of sub-boxes or more room in the ‘shopping basket’ is required,
e05jbf performs reallocation, usually doubling the size of the inadequately-sized arrays. Clearly this process requires periods where the original array and its extension exist in memory simultaneously, so that the data within can be copied, which compounds the complexity of
e05jbf's memory usage. It is possible (although not likely) that if your problem is particularly difficult to solve, or of a large size (hundreds of variables), you may run out of memory.
One array that could be dynamically resized by
e05jbf is the ‘shopping basket’ (
xbaskt on entry to
monit). If the initial attempt to allocate
reals for this array fails,
monit will not be called on exit from
e05jbf.
e05jbf performs better if your problem is well-scaled. It is worth trying (by guesswork perhaps) to rescale the problem if necessary, as sensible scaling will reduce the difficulty of the optimization problem, so that e05jbf will take less computer time.
10
Example
This example finds the global minimum of the ‘peaks’ function in two dimensions
on the box
.
The function has several local minima and one global minimum in the given box. The global minimum is approximately located at , where the function value is approximately .
We use default values for all the optional parameters, and we instruct
e05jbf to use the simple initialization list corresponding to
. In particular, this will set for us the initial point
(see
Section 10.3).
10.1
Program Text
Program Text (e05jbfe.f90)
10.2
Program Data
Program Data (e05jbfe.d)
10.3
Program Results
Program Results (e05jbfe.r)
Note: the remainder of this document is intended for more advanced users. Section 11 contains a detailed description of the algorithm. This information may be needed in order to understand Section 12, which describes the optional parameters that can be set by calls to e05jcf, e05jdf, e05jef, e05jff and/or e05jgf.
11
Algorithmic Details
Here we summarise the main features of the MCS algorithm used in
e05jbf, and we introduce some terminology used in the description of the subroutine and its arguments. We assume throughout that we will only do any work in coordinates
in which
is free to vary. The MCS algorithm is fully described in
Huyer and Neumaier (1999).
11.1
Initialization and Sweeps
Each sub-box is determined by a basepoint and an opposite point . We denote such a sub-box by . The basepoint is allowed to belong to more than one sub-box, is usually a boundary point, and is often a vertex.
An
initialization procedure produces an initial set of sub-boxes. Whenever a sub-box is split along a coordinate
for the first time (in the initialization procedure or later), the splitting is done at three or more user-defined values
at which the objective function is sampled, and at some adaptively chosen intermediate points. At least four children are generated. More precisely, we assume that we are given
and a vector
that, for each
, locates within
the
th coordinate of an
initial point ; that is, if
for some
, then
. A good guess for the global optimum can be used as
.
The initialization points and the vectors
and
are collectively called the
initialization list (and sometimes we will refer to just the initialization points as ‘the initialization list’, whenever this causes no confusion). The initialization data may be input by you, or they can be set to sensible default values by
e05jbf: if you provide them yourself,
should contain
,
should contain
, and
should contain
, for
and
; if you wish
e05jbf to use one of its preset initialization methods, you could choose one of two simple, three-point methods (see
Figure 1). If the list generated by one of these methods contains infinite values, attempts are made to generate a safeguarded list using the function
(which is also used during the splitting procedure, and is described in
Section 11.2). If infinite values persist,
e05jbf exits with
. There is also the option to generate an initialization list with the aid of linesearches (by setting
). Starting with the absolutely smallest point in the root box, linesearches are made along each coordinate. For each coordinate, the local minimizers found by the linesearches are put into the initialization list. If there were fewer than three minimizers, they are augmented by close-by values. The final preset initialization option (
) generates a randomized list, so that independent multiple runs may be made if you suspect a global optimum has not been found. Each call to the initialization routine
e05jaf resets the initial-state vector for the Wichmann–Hill base-generator that is used. Depending on whether you set the optional parameter
Repeatability to
or
, the random state is initialized to give a repeatable or non-repeatable sequence. Then, a random integer between
and
sdlist is selected, which is then used to determine the number of points to be generated in each coordinate; that is,
numpts becomes a constant vector, set to this value. The components of
list are then generated, from a uniform distribution on the root box if the box is finite, or else in a safeguarded fashion if any bound is infinite. The array
is set to point to the best point in
list.
Given an initialization list (preset or otherwise),
e05jbf evaluates
at
, and sets the initial estimate of the global minimum,
, to
. Then, for
, the objective function
is evaluated at
points that agree with
in all but the
th coordinate. We obtain pairs
, for
, with:
, say; with, for
,
and with
The point having the smallest function value is renamed and the procedure is repeated with the next coordinate.
Once
e05jbf has a full set of initialization points and function values, it can generate an initial set of sub-boxes. Recall that the
root box is
, having basepoint
. The opposite point
is a corner of
farthest away from
, in some sense. The point
need not be a vertex of
, and
is entitled to have infinite coordinates. We loop over each coordinate
, splitting the current box along coordinate
into
,
or
sub-intervals with exactly one of the
as endpoints, depending on whether two, one or none of the
are on the boundary. Thus, as well as splitting at
, for
, we split at additional points
, for
. These additional
are such that
where
is the golden-section ratio
, and the exponent
takes the value
or
, chosen so that the sub-box with the smaller function value gets the larger fraction of the interval. Each child sub-box gets as basepoint the point obtained from
by changing
to the
that is a boundary point of the corresponding
th coordinate interval; this new basepoint therefore has function value
. The opposite point is derived from
by changing
to the other end of that interval.
e05jbf can now rank the coordinates based on an estimated variability of . For each we compute the union of the ranges of the quadratic interpolant through any three consecutive , taking the difference between the upper and lower bounds obtained as a measure of the variability of in coordinate . A vector is populated in such a way that coordinate has the th highest estimated variability. For tiebreaks, when the obtained after splitting coordinate belongs to two sub-boxes, the one that contains the minimizer of the quadratic models is designated the current sub-box for coordinate .
Boxes are assigned levels in the following manner. The root box is given level . When a sub-box of level is split, the child with the smaller fraction of the golden-section split receives level ; all other children receive level . The box with the better function value is given the larger fraction of the splitting interval and the smaller level because then it is more likely to be split again more quickly. We see that after the initialization procedure the first level is empty and the non-split boxes have levels , so it is meaningful to choose much larger than . Note that the internal structure of e05jbf demands that be at least .
Examples of initializations in two dimensions are given in
Figure 1. In both cases the initial point is
; on the left the initialization points are
while on the right the points are
In
Figure 1, basepoints and levels after initialization are displayed. Note that these initialization lists correspond to
and
, respectively.
Figure 1: Examples of the initialization procedure
After initialization, a series of
sweeps through levels is begun. A sweep is defined by three steps:
(i) |
scan the list of non-split sub-boxes. Fill a record list according to if there is no box at level , and with pointing to a sub-box with the lowest function value among all sub-boxes with level otherwise, for ; |
(ii) |
the sub-box with label is a candidate for splitting. If the sub-box is not to be split, according to the rules described in Section 11.2, increase its level by and update if necessary. If the sub-box is split, mark it so, insert its children into the list of sub-boxes, and update if any child with level yields a strict improvement of over those sub-boxes at level ; |
(iii) |
increment by . If then displaying monitoring information and start a new sweep; else if then repeat this step; else display monitoring information and go to the previous step. |
Clearly, each sweep ends after at most visits of the third step.
11.2
Splitting
Each sub-box is stored by
e05jbf as a set of information about the history of the sub-box: the label of its parent, a label identifying which child of the parent it is, etc. Whenever a sub-box
of level
is a candidate for splitting, as described in
Section 11.1, we recover
,
, and the number,
, of times coordinate
has been split in the history of
. Sub-box
could be split in one of two ways.
(i) |
Splitting by rank
If , the box is always split. The splitting index is set to a coordinate such that . |
(ii) |
Splitting by expected gain
If , the sub-box could be split along a coordinate where a maximal gain in function value is expected. This gain is estimated according to a local separable quadratic model obtained by fitting to function values. If the expected gain is too small the sub-box is not split at all, and its level is increased by . |
Eventually, a sub-box that is not eligible for splitting by expected gain will reach level and then be split by rank, as long as is large enough. As , the rule for splitting by rank ensures that each coordinate is split arbitrarily often.
Before describing the details of each splitting method, we introduce the procedure for correctly handling splitting at adaptive points and for dealing with unbounded intervals. Suppose we want to split the
th coordinate interval
, where we define
, for
and
, and where
is the basepoint of the sub-box being considered. The descendants of the sub-box should shrink sufficiently fast, so we should not split too close to
. Moreover, if
is large we want the new
splitting value to
not be too large, so we force it to belong to some smaller interval
, determined by
where the function
is defined by
11.2.1
Splitting by rank
Consider a sub-box with level . Although the sub-box has reached a high level, there is at least one coordinate along which it has not been split very often. Among the such that for , select the splitting index to be the coordinate with the lowest (and hence highest variability rank). ‘Splitting by rank’ refers to the ranking of the coordinates by and .
If
, so that
has never been split along coordinate
, the splitting is done according to the initialization list and the adaptively chosen golden-section split points, as described in
Section 11.1. Also as covered there, new basepoints and opposite points are generated. The children having the smaller fraction of the golden-section split (that is, those with larger function values) are given level
. All other children are given level
.
Otherwise, ranges between and in the th coordinate direction. The splitting value is selected to be ; we are not attempting to split based on a large reduction in function value, merely in order to reduce the size of a large interval, so may not be optimal. Sub-box is split at and the golden-section split point, producing three parts and requiring only one additional function evaluation, at the point obtained from by changing the th coordinate to . The child with the smaller fraction of the golden-section split is given level , while the other two parts are given level . Basepoints are assigned as follows: the basepoint of the first child is taken to be , and the basepoint of the second and third children is the point . Opposite points are obtained by changing to the other end of the th coordinate-interval of the corresponding child.
11.2.2
Splitting by expected gain
When a sub-box has level , we compute the optimal splitting index and splitting value from a local separable quadratic used as a simple local approximation of the objective function. To fit this curve, for each coordinate we need two additional points and their function values. Such data may be recoverable from the history of : whenever the th coordinate was split in the history of , we obtained values that can be used for the current quadratic interpolation in coordinate .
We loop over
; for each coordinate we pursue the history of
back to the root box, and we take the first two points and function values we find, since these are expected to be closest to the current basepoint
. If the current coordinate has not yet been split we use the initialization list. Then we generate a local separable model
for
by interpolation at
and the
additional points just collected:
We define the
expected gain in function value when we evaluate at a new point obtained by changing coordinate
in the basepoint, for each
, based on two cases:
(i) |
. We compute the expected gain as
Again, we split according to the initialization list, with the new basepoints and opposite points being as before. |
(ii) |
. Now, the th component of our sub-box ranges from to . Using the quadratic partial correction function
we can approximate the maximal gain expected when changing only. We will choose the splitting value from . We compute
and call the minimizer in .
If the expected best function value satisfies
where is the current best function value (including those function values obtained by local optimization), we expect the sub-box to contain a better point and so we split it, using as splitting index the component with minimal . Equation (1) prevents wasting function calls by avoiding splitting sub-boxes whose basepoints have bad function values. These sub-boxes will eventually be split by rank anyway.
We now have a splitting index and a splitting value . The sub-box is split at as long as , and at the golden-section split point; two or three children are produced. The larger fraction of the golden-section split receives level , while the smaller fraction receives level . If it is the case that and the third child is larger than the smaller of the two children from the golden-section split, the third child receives level . Otherwise it is given the level . The basepoint of the first child is set to , and the basepoint of the second (and third if it exists) is obtained by changing the th coordinate of to . The opposite points are again derived by changing to the other end of the th coordinate interval of .
If equation (1) does not hold, we expect no improvement. We do not split, and we increase the level of by . |
11.3
Local Search
The local optimization algorithm used by
e05jbf uses linesearches along directions that are determined by minimizing quadratic models, all subject to bound constraints. Triples of vectors are computed using
coordinate searches based on linesearches. These triples are used in
triple search procedures to build local quadratic models for
. A trust region-type approach to minimize these models is then carried out, and more information about the coordinate search and the triple search can be found in
Huyer and Neumaier (1999).
The local search starts by looking for better points without being too local, by making a triple search using points found by a coordinate search. This yields a new point and function value, an approximation of the gradient of the objective, and an approximation of the Hessian of the objective. Then the quadratic model for is minimized over a small box, with the solution to that minimization problem then being used as a linesearch direction to minimize the objective. A measure is computed to quantify the predictive quality of the quadratic model.
The third stage is the checking of termination criteria. The local search will stop if more than
visits to this part of the local search have occurred, where
is the value of the optional parameter
Local Searches Limit. If that is not the case, it will stop if the limit on function calls has been exceeded (see the description of the optional parameter
Function Evaluations Limit). The final criterion checks if no improvement can be made to the function value, or whether the approximated gradient
is small, in the sense that
The vector
is the best point at the start of the current loop in this iterative local-search procedure, the constant
is the value of the optional parameter
Local Searches Tolerance,
is the objective value at
, and
is the smallest function value found by the initialization procedure.
Next, e05jbf attempts to move away from the boundary, if any components of the current point lie there, using linesearches along the offending coordinates. Local searches are terminated if no improvement could be made.
The fifth stage carries out another triple search, but this time it does not use points from a coordinate search, rather points lying within the trust region box are taken.
The final stage modifies the trust region box to be bigger or smaller, depending on the quality of the quadratic model, minimizes the new quadratic model on that box, and does a linesearch in the direction of the minimizer. The value of is updated using the new data, and then we go back to the third stage (checking of termination criteria).
The Hessians of the quadratic models generated by the local search may not be positive definite, so
e05jbf uses the general nonlinear optimizer
e04vhf to minimize the models.
12
Optional Parameters
Several optional parameters in e05jbf define choices in the problem specification or the algorithm logic. In order to reduce the number of formal arguments of e05jbf these optional parameters have associated default values that are appropriate for most problems. Therefore, you need only specify those optional parameters whose values are to be different from their default values.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section 12.1.
Optional parameters may be specified by calling one, or more, of the routines
e05jcf,
e05jdf,
e05jef,
e05jff and
e05jgf before a call to
e05jbf.
e05jcf reads options from an external options file, with
Begin and
End as the first and last lines respectively, and with each intermediate line defining a single optional parameter. For example,
Begin
Static Limit = 50
End
The call
Call e05jcf (iopts, comm, lcomm, ifail)
can then be used to read the file on
unit
iopts.
ifail will be zero
on successful exit.
e05jcf should be consulted for a full description of this method of supplying optional parameters.
e05jdf,
e05jef,
e05jff or
e05jgf can be called to supply options directly, one call being necessary for each optional parameter.
e05jdf,
e05jef,
e05jff or
e05jgf should be consulted for a full description of this method of supplying optional parameters.
All optional parameters not specified by you are set to their default values. Valid values of optional parameters specified by you are unaltered by e05jbf and so remain in effect for subsequent calls to e05jbf, unless you explicitly change them.
12.1
Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
- a parameter value,
where the letters , and denote options that take character, integer and real values respectively, and where the letter denotes an option that takes an or value;
- the default value, where the symbol is a generic notation for machine precision (see x02ajf), the symbol stands for the largest positive model number (see x02alf), represents the number of non-fixed variables, and the symbol stands for the maximum number of decimal digits that can be represented (see x02bef).
Option names are case-insensitive and must be provided in full; abbreviations are not recognized.
This special keyword is used to reset all optional parameters to their default values, and any random state stored in the array
comm will be destroyed.
Any option value given with this keyword will be ignored. This optional parameter cannot be queried or got.
Function Evaluations Limit | | Default |
This puts an approximate limit on the number of function calls allowed. The total number of calls made is checked at the top of an internal iteration loop, so it is possible that a few calls more than may be made.
Constraint:
.
Infinite Bound Size | | Default |
This defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to will be regarded as (and similarly any lower bound less than or equal to will be regarded as ).
Constraint:
.
Local Searches | | Default |
If you want to try to accelerate convergence of e05jbf by starting local searches from candidate minima, you will require to be .
Constraint:
.
Local Searches Limit | | Default |
This defines the maximal number of iterations to be used in the trust region loop of the local-search procedure.
Constraint:
.
Local Searches Tolerance | | Default |
The value of
is the multiplier used during local searches as a stopping criterion for when the approximated gradient is small, in the sense described in
Section 11.3.
Constraint:
.
These keywords specify the required direction of optimization. Any option value given with these keywords will be ignored.
These options control the echoing of each optional parameter specification as it is supplied.
List turns printing on,
Nolist turns printing off. The output is sent to the current advisory message unit (as defined by
x04abf).
Any option value given with these keywords will be ignored. This optional parameter cannot be queried or got.
Repeatability | | Default |
For use with random initialization lists (
). When set to
, an internally-initialized random state is stored in the array
comm for use in subsequent calls to
e05jbf.
Constraint:
.
Splits Limit | | Default |
Along with the initialization list
list, this defines a limit on the number of times the root box will be split along any single coordinate direction. If
Local Searches is
you may find the default value to be too small.
Constraint:
.
Static Limit | | Default |
As the default termination criterion, computation stops when the best function value is static for
sweeps through levels. This parameter is ignored if you have specified a target value to reach in
Target Objective Value.
Constraint:
.
Target Objective Error | | Default |
If you have given a target objective value to reach in
(the value of the optional parameter
Target Objective Value),
sets your desired relative error (from above if
Minimize is set, from below if
Maximize is set) between
obj and
, as described in
Section 7. See also the description of the optional parameter
Target Objective Safeguard.
Constraint:
.
Target Objective Safeguard | | Default |
If you have given a target objective value to reach in
(the value of the optional parameter
Target Objective Value),
sets your desired safeguarded termination tolerance, for when
is close to zero.
Constraint:
.
This parameter may be set if you wish
e05jbf to use a specific value as the target function value to reach during the optimization. Setting
overrides the default termination criterion determined by the optional parameter
Static Limit.