e04jdc and e04jec
are a part of the new
NAG optimization modelling suite (see Section 4.1 in the E04 Chapter Introduction)
which allows you to define and solve various problems in a uniform
manner. They also offer various algorithmic additions, such as a
performance improvement on noisy problems, a possibility to progress
towards the solution earlier than after
initial function evaluations, heuristic stopping criteria, recovery
from unavailable function evaluations, and various other algorithmic
updates and tuning. In addition, e04jec
offers a reverse communication interface (see Section 4.2 in the E04 Chapter Introduction) which might be useful in some
environments or if you can parallelize your function evaluations.
e04jcc 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 function 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 .
The function may be called by the names: e04jcc, nag_opt_bounds_bobyqa_func or nag_opt_bounds_qa_no_deriv.
3Description
e04jcc 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 e04jcc.
You must supply a function to calculate the value of at any given point .
The method used by e04jcc is based on BOBYQA, the method of Bound Optimization BY Quadratic Approximation described in Powell (2009). In particular, each iteration of e04jcc 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.
On entry: , the vector at which the objective function is to be evaluated.
3: – double *Output
On exit: must be set to the value of the objective function at .
4: – Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to objfun.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void *. Before calling e04jcc you may allocate memory and initialize these pointers with various quantities for use by objfun when called from e04jcc (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
5: – Integer *Output
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.
Note:objfun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by e04jcc. If your code inadvertently does return any NaNs or infinities, e04jcc is likely to produce unexpected results.
2: – IntegerInput
On entry: , the number of independent variables.
Constraint:
and , where denotes the number of non-fixed variables.
3: – 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: – doubleInput/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 NE_NOERROR on exit, x is the position of the minimum.
5: – const doubleInput
6: – const doubleInput
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 X02ALC).
Constraints:
if is to be fixed at , then;
otherwise , for .
7: – doubleInput
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: – doubleInput
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:
, where , the machine precision.
9: – function, supplied by the userExternal Function
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 specified as NULLFN.
On entry: a lower bound on the current trust region radius.
6: – Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to monfun.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void *. Before calling e04jcc you may allocate memory and initialize these pointers with various quantities for use by monfun when called from e04jcc (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
7: – Integer *Output
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.
10: – IntegerInput
On entry: the maximum permitted number of calls to objfun.
Constraint:
.
11: – double *Output
On exit: the function value at the lowest point found (x).
The NAG communication argument (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
14: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
e04jcc returns with NE_NOERROR if the final trust region radius has reached its lower bound rhoend.
6Error Indicators and Warnings
NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument had an illegal value.
NE_BOUND
On entry, , , and .
Constraint: if in coordinate , .
NE_INT
On entry, .
Constraint: .
There were unequal bounds.
Constraint: .
There were unequal bounds and on entry.
Constraint: .
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL
On entry, .
Constraint: .
On entry, .
Constraint: , where , the machine precision.
NE_REAL_2
On entry, and .
Constraint: .
NE_RESCUE_FAILED
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.
NE_TOO_MANY_FEVALS
The function evaluations limit was reached: objfun has been called maxcal times.
NE_TR_STEP_FAILED
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.
NE_USER_STOP
User-supplied monitoring function requested termination.
User-supplied objective function requested termination.
7Accuracy
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.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e04jcc 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 function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
For each invocation of e04jcc, local workspace arrays of fixed length are allocated internally. The total size of these arrays amounts to double 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.