NAG Library Routine Document
E04JCF
1 Purpose
E04JCF is an easy-to-use algorithm that uses methods of quadratic approximation to find a minimum of an objective function over , subject to fixed lower and upper bounds on the independent variables . Derivatives of are not required.
The routine is intended for functions that are continuous and that have continuous first and second derivatives (although it will usually work even if the derivatives have occasional discontinuities). Efficiency is maintained for large .
2 Specification
SUBROUTINE E04JCF ( |
OBJFUN, N, NPT, X, BL, BU, RHOBEG, RHOEND, MONFUN, MAXCAL, F, NF, IUSER, RUSER, IFAIL) |
INTEGER |
N, NPT, MAXCAL, NF, IUSER(*), IFAIL |
REAL (KIND=nag_wp) |
X(N), BL(N), BU(N), RHOBEG, RHOEND, F, RUSER(*) |
EXTERNAL |
OBJFUN, MONFUN |
|
3 Description
E04JCF is applicable to problems of the form:
where
is a nonlinear scalar function whose derivatives may be unavailable, and where the bound vectors are elements of
. Relational operators between vectors are interpreted elementwise.
Fixing variables (that is, setting for some ) is allowed in E04JCF.
You must supply a subroutine to calculate the value of at any given point .
The method used by E04JCF is based on BOBYQA, the method of Bound Optimization BY Quadratic Approximation described in
Powell (2009). In particular, each iteration of E04JCF generates a quadratic approximation
to
that agrees with
at
automatically chosen interpolation points. The value of
is a constant prescribed by you. Updates to the independent variables mostly occur from approximate solutions to trust-region subproblems, using the current quadratic model.
4 References
Powell M J D (2009) The BOBYQA algorithm for bound constrained optimization without derivatives
Report DAMTP 2009/NA06 University of Cambridge
http://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf5 Parameters
- 1: OBJFUN – SUBROUTINE, supplied by the user.External Procedure
OBJFUN must evaluate the objective function
at a specified vector
.
The specification of
OBJFUN is:
INTEGER |
N, IUSER(*), INFORM |
REAL (KIND=nag_wp) |
X(N), F, RUSER(*) |
|
- 1: N – INTEGERInput
On entry: , the number of independent variables.
- 2: X(N) – REAL (KIND=nag_wp) arrayInput
On entry: , the vector at which the objective function is to be evaluated.
- 3: F – 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: IUSER() – INTEGER arrayUser Workspace
- 5: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
-
OBJFUN is called with the parameters
IUSER and
RUSER as supplied to E04JCF. You are free to use the arrays
IUSER and
RUSER to supply information to
OBJFUN as an alternative to using COMMON global variables.
- 6: INFORM – 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 E04JCF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 2: N – INTEGERInput
On entry: , the number of independent variables.
Constraint:
and , where denotes the number of non-fixed variables.
- 3: NPT – INTEGERInput
On entry: , the number of interpolation conditions imposed on the quadratic approximation at each iteration.
Suggested value:
, where denotes the number of non-fixed variables.
Constraint:
, where denotes the number of non-fixed variables.
- 4: X(N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: an estimate of the position of the minimum. If any component is out-of-bounds it is replaced internally by the bound it violates.
On exit: the lowest point found during the calculations. Thus, if
on exit,
X is the position of the minimum.
- 5: BL(N) – REAL (KIND=nag_wp) arrayInput
- 6: BU(N) – REAL (KIND=nag_wp) arrayInput
On entry: the fixed vectors of bounds: the lower bounds
and the upper bounds
, respectively. To signify that a variable is unbounded you should choose a large scalar
appropriate to your problem, then set the lower bound on that variable to
and the upper bound to
. For well-scaled problems
may be suitable, where
denotes the largest positive model number (see
X02ALF).
Constraints:
- if is to be fixed at , then ;
- otherwise , for .
- 7: RHOBEG – REAL (KIND=nag_wp)Input
On entry: an initial lower bound on the value of the trust-region radius.
Suggested value:
RHOBEG should be about one tenth of the greatest expected overall change to a variable: the initial quadratic model will be constructed by taking steps from the initial
X of length
RHOBEG along each coordinate direction.
Constraints:
- ;
- .
- 8: RHOEND – REAL (KIND=nag_wp)Input
On entry: a final lower bound on the value of the trust-region radius.
Suggested value:
RHOEND should indicate the absolute accuracy that is required in the final values of the variables.
Constraint:
.
- 9: MONFUN – SUBROUTINE, supplied by the NAG Library or the user.External Procedure
MONFUN may be used to monitor the optimization process. It is invoked every time a new trust-region radius is chosen.
If no monitoring is required,
MONFUN may be the dummy monitoring routine E04JCP supplied by the NAG Library.
The specification of
MONFUN is:
INTEGER |
N, NF, IUSER(*), INFORM |
REAL (KIND=nag_wp) |
X(N), F, RHO, RUSER(*) |
|
- 1: N – INTEGERInput
On entry: , the number of independent variables.
- 2: NF – INTEGERInput
On entry: the cumulative number of calls made to
OBJFUN.
- 3: X(N) – REAL (KIND=nag_wp) arrayInput
On entry: the current best point.
- 4: F – REAL (KIND=nag_wp)Input
On entry: the value of
OBJFUN at
X.
- 5: RHO – REAL (KIND=nag_wp)Input
On entry: a lower bound on the current trust-region radius.
- 6: IUSER() – INTEGER arrayUser Workspace
- 7: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
-
MONFUN is called with the parameters
IUSER and
RUSER as supplied to E04JCF. You are free to use the arrays
IUSER and
RUSER to supply information to
MONFUN as an alternative to using COMMON global variables.
- 8: INFORM – INTEGEROutput
On exit: must be set to a value describing the action to be taken by the solver on return from
MONFUN. Specifically, if the value is negative the solution of the current problem will terminate immediately; otherwise, computations will continue.
MONFUN must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which E04JCF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 10: MAXCAL – INTEGERInput
On entry: the maximum permitted number of calls to
OBJFUN.
Constraint:
.
- 11: F – REAL (KIND=nag_wp)Output
On exit: the function value at the lowest point found (
X).
- 12: NF – INTEGEROutput
On exit: unless
or
on exit, the total number of calls made to
OBJFUN.
- 13: IUSER() – INTEGER arrayUser Workspace
- 14: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
-
IUSER and
RUSER are not used by E04JCF, but are passed directly to
OBJFUN and
MONFUN and may be used to pass information to these routines as an alternative to using COMMON global variables.
- 15: IFAIL – INTEGERInput/Output
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction 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 parameter, 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).
E04JCF returns with
if the final trust-region radius has reached its lower bound
RHOEND.
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:
An input parameter is invalid.
The function evaluations limit was reached:
OBJFUN has been called
MAXCAL times.
The predicted reduction in a trust-region step was non-positive. Check your specification of
OBJFUN and whether the function needs rescaling. Try a different initial
X.
A rescue procedure has been called in order to correct damage from rounding errors when computing an update to a quadratic approximation of
, but no further progess could be made. Check your specification of
OBJFUN and whether the function needs rescaling. Try a different initial
X.
You terminated the solver.
You indicated that you wished to halt solution of the current problem by setting
INFORM to a negative value in either
OBJFUN or
MONFUN.
-
Internal memory allocation failed.
7 Accuracy
Experience shows that, in many cases, on successful termination the
-norm distance from the best point
to a local minimum of
is less than
, unless
RHOEND is so small that such accuracy is unattainable.
For each invocation of E04JCF, local workspace arrays of fixed length are allocated internally. The total size of these arrays amounts to
real elements and
integer elements, where
denotes the number of non-fixed variables; that is, the total size is
. If you follow the recommendation for the choice of
NPT on entry, this total size reduces to
.
Usually the total number of function evaluations (
NF) is substantially less than
, and often, if
on entry,
NF is only of magnitude
or less.
9 Example
This example involves the minimization of
subject to
starting from the initial guess
.
9.1 Program Text
Program Text (e04jcfe.f90)
9.2 Program Data
None.
9.3 Program Results
Program Results (e04jcfe.r)