# `optimize._trustregion`¶

Trust-region optimization.

## Module Contents¶

### Classes¶

 `BaseQuadraticSubproblem`(self,x,fun,jac,hess=None,hessp=None) Base/abstract class defining the quadratic model for trust-region

### Functions¶

 `_minimize_trust_region`(fun,x0,args=tuple,jac=None,hess=None,hessp=None,subproblem=None,initial_trust_radius=1.0,max_trust_radius=1000.0,eta=0.15,gtol=0.0001,maxiter=None,disp=False,return_all=False,callback=None,inexact=True,**unknown_options) Minimization of scalar function of one or more variables using a
class `BaseQuadraticSubproblem`(x, fun, jac, hess=None, hessp=None)

Base/abstract class defining the quadratic model for trust-region minimization. Child classes must implement the `solve` method.

Values of the objective function, jacobian and hessian (if provided) at the current iterate `x` are evaluated on demand and then stored as attributes `fun`, `jac`, `hess`.

`__init__`(x, fun, jac, hess=None, hessp=None)
`__call__`(p)
`fun`()

Value of objective function at current iteration.

`jac`()

Value of jacobian of objective function at current iteration.

`hess`()

Value of hessian of objective function at current iteration.

`hessp`(p)
`jac_mag`()

Magniture of jacobian of objective function at current iteration.

`get_boundaries_intersections`(z, d, trust_radius)

Solve the scalar quadratic equation ||z + t d|| == trust_radius. This is like a line-sphere intersection. Return the two values of t, sorted from low to high.

`solve`(trust_radius)
`_minimize_trust_region`(fun, x0, args=tuple, jac=None, hess=None, hessp=None, subproblem=None, initial_trust_radius=1.0, max_trust_radius=1000.0, eta=0.15, gtol=0.0001, maxiter=None, disp=False, return_all=False, callback=None, inexact=True, **unknown_options)

Minimization of scalar function of one or more variables using a trust-region algorithm.

Options for the trust-region algorithm are:
initial_trust_radius : float
Initial trust radius.
max_trust_radius : float
Never propose steps that are longer than this value.
eta : float
Trust region related acceptance stringency for proposed steps.
gtol : float
Gradient norm must be less than gtol before successful termination.
maxiter : int
Maximum number of iterations to perform.
disp : bool
If True, print convergence message.
inexact : bool
Accuracy to solve subproblems. If True requires less nonlinear iterations, but more vector products. Only effective for method trust-krylov.

This function is called by the minimize function. It is not supposed to be called directly.