NAG FL Interface
e04fff (handle_​solve_​dfls)

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

e04fff is a forward communication Derivative-free Optimization (DFO) solver from the NAG optimization modelling suite (DFLS) for small to medium-scale nonlinear least squares problems with bound constraints.

2 Specification

Fortran Interface
Subroutine e04fff ( handle, objfun, monit, nvar, x, nres, rx, rinfo, stats, iuser, ruser, cpuser, ifail)
Integer, Intent (In) :: nvar, nres
Integer, Intent (Inout) :: iuser(*), ifail
Real (Kind=nag_wp), Intent (Inout) :: x(nvar), ruser(*)
Real (Kind=nag_wp), Intent (Out) :: rx(nres), rinfo(100), stats(100)
Type (c_ptr), Intent (In) :: handle, cpuser
External :: objfun, monit
C Header Interface
#include <nag.h>
void  e04fff_ (void **handle,
void (NAG_CALL *objfun)(const Integer *nvar, const double x[], const Integer *nres, double rx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser),
void (NAG_CALL *monit)(const Integer *nvar, const double x[], Integer *inform, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void **cpuser),
const Integer *nvar, double x[], const Integer *nres, double rx[], double rinfo[], double stats[], Integer iuser[], double ruser[], void **cpuser, Integer *ifail)
The routine may be called by the names e04fff or nagf_opt_handle_solve_dfls.

3 Description

e04fff is aimed at minimizing a sum of squares objective function subject to bound constraints:
minimize xn i=1 mr ri x 2 subject to lx x ux .  
Here the rix are smooth nonlinear functions called residuals and lx and ux are n-dimensional vectors defining bounds on the variables. Typically, in a calibration or data fitting context, the residuals will be defined as the difference between the data points and a nonlinear model (see Section 2.2.3 in the E04 Chapter Introduction).
e04fff serves as a solver for compatible problems stored as a handle. The handle points to an internal data structure which defines the problem and serves as a means of communication for routines in the NAG optimization modelling suite. To define a compatible problem handle, you must call e04raf followed by e04rmf to initialize it and optionally call e04rhf to define bounds on the variables. If e04rhf is not called, all the variables will be considered free by the solver. It should be noted that e04fff always assumes that the Jacobian of the residuals is dense, therefore defining a sparse structure for the residuals in the call to e04rmf will have no effect. See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
The solver allows fixing variables with the definition of the bounds. However, the following constraint must be met in order to be able to call the solver:
The solver is based on a derivative-free trust region framework. This type of method is well suited for small to medium-scale problems (around 100 variables) for which the derivatives are unavailable or not easy to compute, and/or for which the function evaluations are expensive or noisy. For a detailed description of the algorithm see Section 11.
The algorithm behaviour and solver strategy can be modified by various optional parameters (see Section 12) which can be set by e04zmf and e04zpf at any time between the initialization of the handle by e04raf and a call to the solver. The optional parameters' names specific for this solver start either with the prefix DFO (Derivative-free Optimization) or DFLS (Derivative-free Least Squares). The default values for these optional parameters are chosen to work well in the general case, but it is recommended you tune them to your particular problem. In particular, if the objective function is known to be noisy, it is highly recommended to set the optional parameter DFO Noisy Problem to YES. Once the solver has finished, options may be modified for the next solve. The solver may be called repeatedly with various starting points and/or optional parameters.
The underlying algorithm implemented for e04fff is the same as the one used by e04fgf. e04fff serves as a forward communication interface to the derivative-free solver for nonlinear least squares problems.

4 References

Cartis C, Fiala J, Marteau B and Roberts L (2018) Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers Technical Report University of Oxford
Cartis C and Roberts L (2017) A Derivative-Free Gauss-Newton Method
Conn A R, Scheinberg K and Vicente L N (2009) Introduction to Derivative-Free Optimization, vol. 8 of MPS-SIAM Series on Optimization MPS/SIAM, Philadelphia
Powell M J D (2009) The BOBYQA algorithm for bound constrained optimization without derivatives Report DAMTP 2009/NA06 University of Cambridge https://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf
Zhang H, Conn A R and Scheinberg K (2010) A Derivative-Free Algorithm for Least-Squares Minimization SIAM J. Optim. 20(6) 3555–3576

5 Arguments

1: handle Type (c_ptr) Input
On entry: the handle to the problem. It needs to be initialized by e04raf and the objective must be declared as nonlinear least squares by a call to the routine e04rmf. The routine e04rhf can optionally be called to define box bounds. It must not be changed between calls to the NAG optimization modelling suite.
2: objfun Subroutine, supplied by the user. External Procedure
objfun must evaluate the value of the nonlinear residuals rix at a specified point x.
The specification of objfun is:
Fortran Interface
Subroutine objfun ( nvar, x, nres, rx, inform, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar, nres
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar)
Real (Kind=nag_wp), Intent (Inout) :: ruser(*)
Real (Kind=nag_wp), Intent (Out) :: rx(nres)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  objfun_ (const Integer *nvar, const double x[], const Integer *nres, double rx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the number of variables in the problem, as set during the initialization of the handle by e04raf.
2: xnvar Real (Kind=nag_wp) array Input
On entry: x, the vector of variable values at which the residuals ri are to be evaluated.
3: nres Integer Input
On entry: mr, the number of residuals in the problem, as set during the initialization of the handle by e04rmf.
4: rxnres Real (Kind=nag_wp) array Output
On exit: the value of the residuals rix at x.
5: inform Integer Input/Output
On entry: a non-negative value.
On exit: may be used to indicate that the requested objective value could not be computed. Specifically, it can be set to a negative value:
inform=-1
The solver will attempt a rescue procedure and request an alternative point. If the rescue procedure fails, the solver will exit with ifail=17.
inform=-2
The solver will cleanly exit with ifail=20 and return the best available point as well as the solve statistics.
6: iuser* Integer array User Workspace
7: ruser* Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
objfun is called with the arguments iuser, ruser and cpuser as supplied to e04fff. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to objfun.
objfun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which e04fff 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 e04fff. If your code inadvertently does return any NaNs or infinities, e04fff is likely to produce unexpected results.
3: monit Subroutine, supplied by the NAG Library or the user. External Procedure
monit is provided to enable you to monitor the progress of the optimization and, if necessary, to halt the optimization process.
If no monitoring is required, monit may be the dummy subroutine e04ffu supplied in the NAG Library.
monit is called at the end of every ith step where i is controlled by the optional parameter DFO Monitor Frequency (default value 0, monit is never called).
The specification of monit is:
Fortran Interface
Subroutine monit ( nvar, x, inform, rinfo, stats, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar), rinfo(100), stats(100)
Real (Kind=nag_wp), Intent (Inout) :: ruser(*)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  monit_ (const Integer *nvar, const double x[], Integer *inform, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the number of variables in the problem.
2: xnvar Real (Kind=nag_wp) array Input
On entry: the current best point.
3: inform Integer Input/Output
On entry: a non-negative value.
On exit: may be used to request the solver to stop immediately. Specifically, if inform<0, then the value of rx will be discarded and the solver will terminate immediately with ifail=20 otherwise, the solver will proceed normally.
4: rinfo100 Real (Kind=nag_wp) array Input
On entry: best objective value computed and various indicators (the values are as described in the main argument rinfo).
5: stats100 Real (Kind=nag_wp) array Input
On entry: solver statistics at monitoring steps or at the end of the current iteration (the values are as described in the main argument stats).
6: iuser* Integer array User Workspace
7: ruser* Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
monit is called with the arguments iuser, ruser and cpuser as supplied to e04fff. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to monit.
monit must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which e04fff is called. Arguments denoted as Input must not be changed by this procedure.
4: nvar Integer Input
On entry: n, the number of variables in the problem. It must be unchanged from the value set during the initialization of the handle by e04raf.
Constraint: nvar1.
5: xnvar Real (Kind=nag_wp) array Input/Output
On entry: x0, the initial estimates of the variables x.
On exit: the final values of the variables x.
6: nres Integer Input
On entry: mr, the number of residuals in the problem. It must be unchanged from the value set during the definition of the objective structure by e04rmf.
Constraint: nres0.
7: rxnres Real (Kind=nag_wp) array Output
On exit: the values of the residuals at the final point given in x.
8: rinfo100 Real (Kind=nag_wp) array Output
On exit: optimal objective value and various indicators at monitoring steps or at the end of the final iteration. The measures are given in the table below:
1 Objective function value fx (sum of the squared residuals).
2 ρ, the current lower bound of the trust region.
3 Δ, the current size of the trust region.
4 The number of interpolation points used by the solver.
5-100 Reserved for future use.
9: stats100 Real (Kind=nag_wp) array Output
On exit: solver statistics at monitoring steps or at the end of the final iteration as given in the table below:
1 Number of calls to the objective function.
2 Total time spent in the solver (including time spent evaluating the objective).
3 Total time spent evaluating the objective function.
4 Number of steps.
5-100 Reserved for future use.
10: iuser* Integer array User Workspace
11: ruser* Real (Kind=nag_wp) array User Workspace
12: cpuser Type (c_ptr) User Workspace
iuser, ruser and cpuser are not used by e04fff, but are passed directly to objfun and monit and may be used to pass information to these routines. If you do not need to reference cpuser, it should be initialized to c_null_ptr.
13: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, because for this routine the values of the output arguments may be useful even if ifail0 on exit, the recommended value is -1. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
Note: in some cases e04fff may return useful information.
ifail=1
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by e04raf or it has been corrupted.
ifail=2
The problem is already being solved.
This solver does not support the model defined in the handle.
ifail=4
The information supplied does not match with that previously stored.
On entry, nres=value must match that given during the definition of the objective in the handle, i.e., value.
The information supplied does not match with that previously stored.
On entry, nvar=value must match that given during initialization of the handle, i.e., value.
ifail=5
Inconsistent optional parameters DFO Trust Region Tolerance ρend and DFO Trust Region Slow Tol ρtol.
Constraint: ρend<ρtol.
Use e04zmf to set compatible option values.
Inconsistent optional parameters DFO Trust Region Tolerance ρend and DFO Starting Trust Region ρbeg.
Constraint: ρend<ρbeg.
Use e04zmf to set compatible option values.
Optional parameter DFO Starting Trust Region ρbeg=value, lxi=value, uxi=value and i=value.
Constraint: if lxiuxi in coordinate i, then uxi-lxi2×ρbeg.
Use e04zmf to set compatible option values.
ifail=6
Initial number of interpolation points ninit=value, total number of interpolation points npts=value, number of variables nvar=value.
Constraint: growing interpolation set is only supported for linear models (npts=nvar+1).
Use DFO Number Interp Points and DFO Number Initial Points to control the number of interpolation points.
The number of initial interpolation points is greater than the maximum.
Use DFO Number Interp Points and DFO Number Initial Points to control the number of interpolation points.
There were nr=value unequal bounds and the optional parameter DFO Number Interp Points npt=value.
Constraint: nr+1nptnr+1×nr+22 .
Use e04zmf to set compatible option values.
ifail=8
Maximization is not possible for a nonlinear least squares problem.
nres=0. There are no residuals, the objective function is empty.
ifail=17
Rescue failed: the trust region could not be reduced further after some function evaluation could not be provided. Check the specification of your objective and whether it needs rescaling. Try a different initial x.
Some initial interpolation points were not provided. Rescue cannot be attempted at this stage.
Check the specification of your objective and whether it needs rescaling. Try a different initial x.
ifail=18
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.
ifail=19
A rescue procedure has been called in order to correct damage from rounding errors when computing an update to a quadratic approximation of F, but no further progress could be made. Check your specification of objfun and whether the function needs rescaling. Try a different initial x.
ifail=20
User requested termination after a call to the objective function. inform was set to a value lower than -1 within the user-supplied function objfun.
User requested termination during a monitoring step. inform was set to a value lower than 0 within the user-supplied function monit.
ifail=21
Maximum number of function evaluations exceeded.
ifail=23
The solver terminated after the maximum time allowed was exceeded.
Maximum number of seconds exceeded. Use optional parameter Time Limit to reset the limit.
ifail=24
No progress, the solver was stopped after value consecutive slow steps.
Use the optional parameter DFO Maximum Slow Steps to modify the maximum number of slow steps accepted.
The solver stopped after 5×DFO Maximum Slow Steps consecutive slow steps and a trust region above the tolerance set by DFO Trust Region Slow Tol.
ifail=50
The problem was solved to an acceptable level after value consecutive slow iterations.
Use the optional parameter DFO Maximum Slow Steps to modify the maximum number of slow steps accepted.
The solver stopped after DFO Maximum Slow Steps consecutive slow steps and a trust region below the tolerance set by DFO Trust Region Slow Tol.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

In a non-noisy case, the solver can declare convergence on two conditions.
  1. (i)The trust region radius is below the tolerance ρend set by the optional parameter DFO Trust Region Tolerance. When this condition is met, the corresponding solution will generally be at a distance smaller than 10×ρend of a local minimum.
  2. (ii)The sum of the square of the residuals is below the tolerance set by the optional parameter DFLS Small Residuals Tol. In a data fitting context, this condition means that the error between the observed data and the model is smaller than the requested tolerance.
If the objective is declared as noisy by the optional parameter DFO Noisy Problem, the solver declares convergence more conservatively. Instead of stopping with the first condition, the solver will trigger soft restarts (see Section 11 for more details) to ensure it did not get stuck in a flat region because of the noise. The solver then declares convergence when it is reasonably sure that it has reached a local minimum.
  1. (i)The total number of restarts is greater than the limit set by optional parameter DFO Max Soft Restarts and the trust region radius is below the tolerance.
  2. (ii)The number of consecutive restarts that did not manage to decrease the objective function is greater than the limit set by the optional parameter DFO Max Unsucc Soft Restarts.
In addition, this solver can stop if the convergence is deemed too slow on two conditions.
  1. (i)The trust region lower bound is lower than the value set by the optional parameter DFO Trust Region Slow Tol and the number of consecutive slow steps is greater than the value set by DFO Maximum Slow Steps.
  2. (ii)The trust region lower bound is greater than the value set by the optional parameter DFO Trust Region Slow Tol and the number of consecutive slow steps is greater than five times the value set by DFO Maximum Slow Steps.
The slow convergence detection can be deactivated by setting DFO Maximum Slow Steps to 0.

8 Parallelism and Performance

e04fff is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e04fff 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.

9 Further Comments

9.1 Description of the Printed Output

The solver can print information to give an overview of the problem and the progress of the computation. The output may be sent to two independent unit numbers which are set by optional parameters Print File and Monitoring File. Optional parameters Print Level, Print Options, Monitoring Level and Print Solution determine the exposed level of detail. This allows, for example, a detailed log file to be generated while the condensed information is displayed on the screen.
By default (Print File=6, Print Level=2), four sections are printed to the standard output: a header, a list of options, an iteration log and a summary.
Header
The header contains statistics about the problem. It should look like:
---------------------------------------------------
E04F(G|F)), Derivative-free solver for data fitting
            (nonlinear least squares problems)
---------------------------------------------------

Problem statistics
  Number of variables                 10
  Number of unconstrained variables   10
  Number of fixed variables            0
  Starting interpolation points       11
  Total interpolation points          11
  Number of residuals                 10
Optional parameters list
If Print Options=YES, a list of the optional parameters and their values is printed. The list shows all options of the solver, each displayed on one line. The line contains the option name, its current value and an indicator for how it was set. The options left at their defaults are noted by ‘d’ and the ones you have set are noted by ‘U’. Note that the output format is compatible with the file format expected by e04zpf. The output looks as follows:
Stats Time                    =                 Yes     * U
Dfo Trust Region Tolerance    =         1.00000E-07     * U
Dfo Max Objective Calls       =                 500     * d
Dfo Starting Trust Region     =         1.10000E-01     * U
Dfo Number Interp Points      =                   0     * d
Iteration log
If Print Level2, the solver will print a summary line for each step. An iteration is considered successful when it yields a decrease of the objective sufficiently close to the decrease predicted by the quadratic model. Each line shows the step number (step), the value of the objective function (obj), the lower bound on the radius of the trust region (rho), and the cumulative number of objective function evaluations (nf). The output looks as follows:
----------------------------------------
 step |    obj        rho    |    nf   |
----------------------------------------
    1 |  3.87E+01  1.00E-01  |    12   |
    2 |  3.39E+01  1.00E-01  |    13   |
    3 |  1.78E+01  1.00E-01  |    14   |
    4 |  3.95E-29  1.00E-01  |    15   |
Occasionally, the letter ‘s’ is printed at the end of the line indicating that the progress is considered slow by the slow convergence detection heuristic. After a certain number of consecutive slow steps, the solver is stopped. The limit on the number of slow iterations can be controlled by the optional parameter DFO Maximum Slow Steps and the tolerance on the trust region radius before the solver can be stopped is driven by DFO Trust Region Slow Tol.
If Print Level3, each line additionally shows the current value of the trust region radius (delta) as well as the step length (||d||) taken. It might look as follows:
------------------------------------------------------------
 step |    obj        rho      delta     ||d||   |    nf   |
------------------------------------------------------------
    1 |  4.02E+00  1.00E-01  4.00E-01  1.00E-01  |     4   |
    2 |  3.66E+00  1.00E-01  4.00E-01  4.00E-01  |     5   |
    3 |  3.48E+00  1.00E-01  4.00E-01  4.00E-01  |     6   |
    4 |  2.32E+00  1.00E-01  4.00E-01  1.00E-01  |     9   |
Summary
Once the solver finishes, a summary is produced:
Status: Converged, small residuals
 
Value of the objective                    3.95417E-29
Number of objective function evaluations           15
Number of steps                                     4
Note that only the iterations that decrease the objective function are printed in the iteration log, meaning that objective evaluations are likely to happen between the last printed iteration and the convergence. This leads to a small difference between the last line of the iteration log and the final summary in terms of the number of function evaluations.
Optionally, if Stats Time=YES, the timings are printed:
Timings
      Total time spent in the solver            0.056
      Time spent in the objective evaluation    0.012
Additionally, if Print Solution=YES, the solution is printed along with the bounds:
Computed Solution:
  idx   Lower bound        Value      Upper bound
    1       -inf       -1.00000E+00        inf
    2       -inf       -1.00000E+00        inf
    3       -inf       -1.00000E+00        inf
    4       -inf       -1.00000E+00        inf

9.2 Internal Changes

Internal changes have been made to this routine as follows:
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.

10 Example

In this example, we minimize the Kowalik and Osborne function with bounds on some of the variables. In this problem, the number of variables n=4 and the number of residuals mr=11. The residuals ri are computed by
rix = zi- yi yi+ x2 yi yi+ x3 +x4 x1,  
where
y = 4.0000,2.0000,1.0000,0.5000,0.2500,0.1670,0.1250,0.1000,0.0833,0.0714,0.0625 z = 0.1957,0.1947,0.1735,0.1600,0.0844,0.0627,0.0456,0.0342,0.0323,0.0235,0.0246 .  
The following bounds are defined on the variables
0.2 x2 1.0 0.3 x4 .  
The initial guess is
x0= 0.25,0.39,0.415,0.39.  
The expected solution is
x*= 0.1813,0.5901,0.2569,0.3000 .  

10.1 Program Text

Program Text (e04fffe.f90)

10.2 Program Data

None.

10.3 Program Results

Program Results (e04fffe.r)

11 Algorithmic Details

This section contains a short description of the algorithm used in e04fff which is based on the collaborative work between NAG and the University of Oxford (Cartis and Roberts (2017) and Cartis et al. (2018)). It uses a model-based derivative-free trust region framework adapted to exploit least squares problems structure.

11.1 Derivative-free Trust Region Algorithm

In this section, we are interested in generic problems of the form
minimize xn fx  
where the derivatives of the objective function f are not easily available. A model-based DFO algorithm maintains a set of points Yk centred on an iterate xk to build quadratic interpolation models of the objective
fxk+s ϕks= fxk+ gkTs+ 12 sT Hk s ,  
where gk and Hk are built with the interpolation conditions
yYk , ​ϕk y-xk =fy . (1)
Note that if the number of interpolation points npt is smaller than nr+1×nr+22, the model chosen is the one for which the Hessian Hk is the closest to Hk-1 in the Frobenius norm sense. This model is iteratively optimized over a trust region, updated and moved around the new computed points. More precisely, it can be described as:
In the following sections, we call an iteration ‘successful’ when the trial point xk+sk is accepted as the next iterate.

11.2 Bounds on the Variables

The bounds on the variables are handled during the model optimization step (step 2(i) of DFO Algorithm) with an active set method. If a bound is hit, it is fixed and step 2(i) is restarted.

11.3 Adaptation to Nonlinear Least Squares Problems

In the specific case where f is a sum of square fx=i=1mrrix2, a good approximation of the Hessian of the objective can be
2fx JxT Jx ,  
where J is the mr by n first derivative matrix of f. This approximation is the main idea behind the Gauss–Newton and Levenberg–Marquardt methods. Following the work of Zhang et al. (2010), it is possible to adapt it to the DFO framework. In e04fff, one linear model is built for each residual ri
rix+s rix+ giTs.  
Let J=g1,g2,T. To build the model of the objective f, we then choose
fx+s ϕs= fx+ gfTs+ 12sTHfs,  
where gf is chosen as
gf= JTfx,  
and Hf as
Hf= JTJ + 0 if gfκ1 κ3 fxI if gf<κ1   and   12 fx< κ2gf.  
The first expression amounts to making a Gauss–Newton approximation when we are far from a stationary point and the second to a Levenberg–Marquardt approximation when we are close to a stationary point with small residuals.
e04fff integrates this method of building models into the framework presented in the DFO Algorithm.

11.4 Growing the Interpolation Set

In the case where the function is very expensive, it might be desirable for the solver to make some progress before the nr+1 evaluations necessary to build the first interpolation model are done. To get that behaviour, you can set the optional parameter DFO Number Initial Points, controlling the number of initial interpolation points, to a value that is lower than nr+1. The solver will then start its iteration earlier while adding random perturbations to the interpolation models to ensure that the full space is explored.
It is to be noted that this mode will typically not lead to a faster convergence to the solution and should only be used if early progress is desirable.

11.5 Dealing with Noisy Problems

If the problem solved is known to be noisy, declaring it as such to the solver with the optional parameter DFO Noisy Problem will modify the behaviour of the solver to take into account the uncertainty of the function evaluations. The two main features implemented to handle noisy objective functions are:
  1. (i)slow update of the trust regions;
  2. (ii)soft restarts of the algorithm can be performed instead of declaring convergence to ensure the solver did not get stuck in a flat region due to the noise.
A soft restart consists of a reset of the trust region's values to the starting ones and a few objective evaluations to improve the geometry of the interpolation set in the new trust region. It is possible to control the number of objective evaluations performed during a soft restart with the optional parameter DFO Number Soft Restarts Pts. After a set maximum number of restarts (DFO Max Soft Restarts) or maximum number of unsuccessful restarts (DFO Max Unsucc Soft Restarts), the solver will declare convergence in the usual way.

12 Optional Parameters

Several optional parameters in e04fff define choices in the problem specification or the algorithm logic. In order to reduce the number of formal arguments of e04fff 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 optional parameters can be changed by calling e04zmf anytime between the initialization of the handle and the call to the solver. Modification of the optional parameters during intermediate monitoring stops is not allowed. Once the solver finishes, the optional parameters can be altered again for the next solve.
The option values may be retrieved by e04znf.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in Section 12.1.

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:
All options accept the value DEFAULT to return single options to their default states.
Keywords and character values are case and white space insensitive.
Defaults
This special keyword may be used to reset all optional parameters to their default values. Any value given with this keyword will be ignored.
DFLS Small Residuals TolrDefault =ε0.75
This option defines the tolerance on the value of the residuals. Namely, the solver declares convergence if
f x = i=1 mr ri x 2 < DFLS Small Residuals Tol .  
Constraint: DFLS Small Residuals Tol>ε2.
DFO Initial Interp PointsaDefault =Coordinate
Determines how the initial interpolation points are chosen. If DFO Initial Interp Points=Coordinate, the interpolation points are chosen along the coordinate directions around the initial point. If DFO Initial Interp Points=Random, the initial interpolation points are chosen along random orthogonal directions around the initial point. Set DFO Random Seed to a positive value to fix the random seed and get reproducible results.
Constraint: DFO Initial Interp Points=Coordinate or Random.
DFO Maximum Slow StepsiDefault =20
If DFO Maximum Slow Steps>0, this parameter defines the maximum number of consecutive slow iterations nslow allowed. Set DFO Maximum Slow Steps=0 to deactivate the slow iteration detection. The algorithm can stop in two situations:
  1. (i)nslow>DFO Maximum Slow Steps and ρ<DFO Trust Region Slow Tol with ifail=50,
  2. (ii)nslow>5×DFO Maximum Slow Steps with ifail=24.
Constraint: DFO Maximum Slow Steps0.
DFO Max Objective CallsiDefault =500
A limit on the number of objective function evaluations the solver is allowed to compute. If the limit is reached, the solver stops with ifail=21.
Constraint: DFO Max Objective Calls1.
DFO Max Soft RestartsiDefault =5
The maximum total number of soft restarts that can be performed if the objective function is declared as noisy (DFO Noisy Problem=YES).
Constraint: DFO Max Soft Restarts1.
DFO Max Unsucc Soft RestartsiDefault =3
The maximum number of consecutive unsuccessful soft restarts that can be performed if the objective function is declared as noisy (DFO Noisy Problem=YES).
Constraint: DFO Max Unsucc Soft Restarts1.
DFO Monitor FrequencyiDefault =0
If DFO Monitor Frequency>0, monit will be called at the end of every ith step for monitoring purposes.
Constraint: DFO Monitor Frequency0.
DFO Noise LevelrDefault =0.0
Indicates the noise level expected when evaluating the objective function if DFO Noisy Problem=YES.
Constraint: DFO Noise Level0.0.
DFO Noisy ProblemaDefault =NO
Indicates if the function evaluations provided to the solver are noisy. If DFO Noisy Problem=YES, some algorithmic features will be activated:
  1. (i)The trust region update becomes slower to reflect the decreased confidence in the objective values.
  2. (ii)Soft restarts of the algorithm can be performed to ensure the algorithm did not get stuck because of the noise (see DFO Max Soft Restarts, DFO Max Unsucc Soft Restarts and DFO Number Soft Restarts Pts to control the restart characteristics).
  3. (iii)In addition, if DFO Noise Level>0.0, the solver will trigger a soft restart if all the function values are within the noise level.
DFO Number Initial PointsiDefault =0
The initial number of interpolation points in Y0 (1) used to build the linear models of the residuals. If DFO Number Initial Points=0, the number of points is chosen to be equal to the total number of interpolation points set by DFO Number Interp Points.
If this parameter is chosen to be lower than the maximum set by DFO Number Interp Points, the solver will progressively increase the number of interpolation points until it reaches that value. In this release, it is only possible to grow the interpolation set if DFO Number Interp Points is set to the default value.
Constraint: DFO Number Initial Points0.
Consistency constraint, the solver stops with ifail=6 if not met:
DFO Number Interp PointsiDefault =0
The maximum number of interpolation points in Yk (1) used to build the linear models of the residuals. If DFO Number Interp Points=0, the number of points is chosen to be nr+1 where nr is the number of non-fixed variables.
Constraint: DFO Number Interp Points0.
Consistency constraint, the solver stops with ifail=6 if not met:
DFO Number Soft Restarts PtsiDefault =3
The number of interpolation points that are replaced during a soft restart.
Constraint: DFO Number Soft Restarts Pts1.
DFO Print FrequencyiDefault =1
If DFO Print Frequency>0, the solver prints the iteration log to the appropriate units at the end of every ith step.
Constraint: DFO Print Frequency0.
DFO Random SeediDefault =-1
The random seed used to generate the random points used to build the initial model or build the underdetermined models when the interpolation set has not fully grown (DFO Number Initial Points<DFO Number Interp Points). If DFO Random Seed<0, the random seed will be based on values taken from the real-time clock, potentially resulting in the solver taking a different path each time it is run. Set it to a positive value to get fully reproducible runs.
Constraint: DFO Print Frequency-1.
DFO Starting Trust RegionrDefault =0.1
ρbeg, the initial trust region radius. This parameter should be set to 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 ρbeg along each coordinate direction. The default value assumes that the variables have an order of magnitude 1.
Constraint: DFO Starting Trust Region>ε.
Consistency constraints, the solver stops with ifail=5 if not met:
DFO Trust Region Slow TolrDefault =ε0.25
The minimal acceptable trust region radius for the solution to be declared as acceptable. The solver stops if:
Constraint: DFO Trust Region Slow Tol>ε.
Consistency constraint, the solver stops with ifail=5 if not met:
DFO Trust Region TolerancerDefault =ε0.37
ρend, the requested trust region radius. The algorithm declares convergence when the trust region radius reaches this limit. It should indicate the absolute accuracy that is required in the final values of the variables.
Constraint: DFO Trust Region Tolerance>ε.
Consistency constraints, the solver stops with ifail=5 if not met:
DFO VersionaDefault =Latest
At Mark 27, the underlying algorithm of e04fff underwent significant changes. This option allows you to continue using the Mark 26 version if it is set to '26'. By default (recommended), the latest version of the code is called.
Constraint: DFO Version=Latest or 26.
Infinite Bound SizerDefault =1020
This defines the ‘infinite’ bound bigbnd in the definition of the problem constraints. Any upper bound greater than or equal to bigbnd will be regarded as + (and similarly any lower bound less than or equal to -bigbnd will be regarded as -). Note that a modification of this optional parameter does not influence constraints which have already been defined; only the constraints formulated after the change will be affected.
Constraint: Infinite Bound Size1000.
Monitoring FileiDefault =-1
If i0, the unit number for the secondary (monitoring) output. If Monitoring File=-1, no secondary output is provided. The information output to this unit is controlled by Monitoring Level.
Constraint: Monitoring File-1.
Monitoring LeveliDefault =4
This parameter sets the amount of information detail that will be printed by the solver to the secondary output. The meaning of the levels is the same as with Print Level.
Constraint: 0Monitoring Level5.
Print FileiDefault =advisory message unit number
If i0, the unit number for the primary output of the solver. If Print File=-1, the primary output is completely turned off independently of other settings. The default value is the advisory message unit number as defined by x04abf at the time of the optional parameters initialization, e.g., at the initialization of the handle. The information output to this unit is controlled by Print Level.
Constraint: Print File-1.
Print LeveliDefault =2
This parameter defines how detailed information should be printed by the solver to the primary and secondary output.
i Output
0 No output from the solver.
1 The Header and Summary.
2, 3, 4, 5 Additionally, the Iteration log.
Constraint: 0Print Level5.
Print OptionsaDefault =YES
If Print Options=YES, a listing of optional parameters will be printed to the primary output and is always printed to the secondary output.
Constraint: Print Options=YES or NO.
Print SolutionaDefault =NO
If Print Solution=YES, the solution will be printed to the primary and secondary output.
Constraint: Print Solution=YES or NO.
Stats TimeaDefault =NO
This parameter turns on timings of various parts of the algorithm to give a better overview of where most of the time is spent. This might be helpful for a choice of different solving approaches. It is possible to choose between CPU and wall clock time. Choice YES is equivalent to WALL CLOCK.
Constraint: Stats Time=YES, NO, CPU or WALL CLOCK.
Time LimitrDefault =106
A limit to the number of seconds that the solver can use to solve one problem. If during the convergence check this limit is exceeded, the solver will terminate with ifail=23.
Constraint: Time Limit>0.