naginterfaces.library.opt.bounds_​bobyqa_​func

naginterfaces.library.opt.bounds_bobyqa_func(objfun, npt, x, bl, bu, rhobeg, rhoend, maxcal, monfun=None, data=None)[source]

bounds_bobyqa_func 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 .

Deprecated since version 27.0.0.0: bounds_bobyqa_func is deprecated. Please use handle_solve_dfno() and handle_solve_dfno_rcomm() instead. See also the Replacement Calls document.

For full information please refer to the NAG Library document for e04jc

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/e04/e04jcf.html

Parameters
objfuncallable f = objfun(x, data=None)

must evaluate the objective function at a specified vector .

Parameters
xfloat, ndarray, shape

, the vector at which the objective function is to be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
ffloat

Must be set to the value of the objective function at .

nptint

, the number of interpolation conditions imposed on the quadratic approximation at each iteration.

Suggested value: , where denotes the number of non-fixed variables.

xfloat, array-like, shape

An estimate of the position of the minimum. If any component is out-of-bounds it is replaced internally by the bound it violates.

blfloat, array-like, shape

must contain the fixed vector of lower bounds, .

bufloat, array-like, shape

must contain the fixed vector of upper bounds, .

rhobegfloat

An initial lower bound on the value of the trust region radius.

Suggested value: 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 of length along each coordinate direction.

rhoendfloat

A final lower bound on the value of the trust region radius.

Suggested value: should indicate the absolute accuracy that is required in the final values of the variables.

maxcalint

The maximum permitted number of calls to .

monfunNone or callable monfun(nf, x, f, rho, data=None), optional

Note: if this argument is None then a NAG-supplied facility will be used.

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, may be None.

Parameters
nfint

The cumulative number of calls made to .

xfloat, ndarray, shape

The current best point.

ffloat

The value of at .

rhofloat

A lower bound on the current trust region radius.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

dataarbitrary, optional

User-communication data for callback functions.

Returns
xfloat, ndarray, shape

The lowest point found during the calculations. Thus, if no exception or warning is raised on exit, is the position of the minimum.

ffloat

The function value at the lowest point found ().

nfint

Unless = 1 or NagMemoryError on exit, the total number of calls made to .

Raises
NagValueError
(errno )

There were unequal bounds and on entry.

Constraint: .

(errno )

There were unequal bounds.

Constraint: .

(errno )

On entry, , , and .

Constraint: if in coordinate , .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: , where , the machine precision.

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicMajorWarning
(errno )

The function evaluations limit was reached: has been called times.

(errno )

The predicted reduction in a trust region step was non-positive. Check your specification of and whether the function needs rescaling. Try a different initial .

(errno )

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 and whether the function needs rescaling. Try a different initial .

NagCallbackTerminateWarning
(errno )

User-supplied objective function requested termination.

(errno )

User-supplied monitoring function requested termination.

Notes

bounds_bobyqa_func 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 bounds_bobyqa_func.

You must supply a function to calculate the value of at any given point .

The method used by bounds_bobyqa_func is based on BOBYQA, the method of Bound Optimization BY Quadratic Approximation described in Powell (2009). In particular, each iteration of bounds_bobyqa_func 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.

References

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