Optimization::TrustRegion Function

Overload List

#SignatureDescription
1int TrustRegion(TVectorFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, const DewArray<double> &Consts, const DewArray<tObject *> &OConsts, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);Trust region algorithm for finding minimum of vector function.
2int TrustRegion(TMKLTRFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, tObject *CustomData, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);
3int TrustRegion(TVectorFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, TVec *LB, TVec *UB, const DewArray<double> &Consts, const DewArray<tObject *> &OConsts, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);Trust region algorithm to find bounded minimum of vector function.
4int TrustRegion(TMKLTRFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, tObject *CustomData, TVec *LB, TVec *UB, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);

Overload 1: int TrustRegion(TVectorFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, const DewArray<double> &Consts, const DewArray<tObject *> &OConsts, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);

Trust region algorithm for finding minimum of vector function.

#NameTypeDescription
1FunTVectorFunctionThe objective function to be minimized.
2JacProcTJacobianFunctionThe Jacobian matrix calculation procedure. If it is nil, then the numerical approximation will be used to evaluate Jacobi matrix elements.
3XTVec *Stores the initial estimates for X. On completion returns estimates, evaluated at function minimum.
4YTVec *Returns objective function value, evaluated at minimum.
5Constsconst DewArray<double> &Additional Fun constant parameteres (can be/is usually nil).
6OConstsconst DewArray<tObject *> &Additional Fun constant parameteres (can be/is usually nil).
7MaxIterintDefines the maximum number of main TR algorithm loops.
8MaxTrialIterintDefines the maximum number of iterations of trial-step calculation.
9EPSArrayconst DewArray<double> &Array of size 6. Contains stopping tests. * eps[0]: Grad < eps[0] * eps[1]: ||F(x)|| < eps[1] * eps[2]: ||A(x)ij|| < eps[2] * eps[3]: ||s|| < eps[3] * eps[4]: ||F(x)||- ||F(x) - A(x)s|| < eps[4] * eps[5]: trial step precision. If eps[5] = 0, then eps[5] = 1E-10, where * A(x) = the jacobi matrix * F(x) = ||y - f(x)||
10RsdoublePositive input variable used in determining the initial step bound, the initial size of the trust region. In most cases the factor should lie within the interval (0.1, 100.0). The generally recommended value is 100, which is used by default, if this param is set to 0.
11StopReasonTOptStopReason &Returns the TR algorithm stop reason.
12Control = nullTOptControl *Optional object, which allows the interruption of the search.

Returns: the number of iterations needed for results.

Remarks:

What it computes. Solves the nonlinear least-squares problem
min_x 1/2 || F(x)||_2^2 for the residual vector F(x)=yf(x)F(x)=y-f(x) using Intel MKL's derivative trust-region solver (dtrnlsp; the bounded overload uses dtrnlspbc with the box LB <= x <= UB). At each step a trial step is accepted only if it stays inside the current trust region, whose radius is grown or shrunk from the agreement between the model and the true decrease. The Jacobian A(x)=d F/d x is supplied by JacProc or, when that is nil, approximated numerically.

Domain. X holds the n starting variables; Y
receives the m residual components (its length sets m). This is a double-precision routine; drive it with mvDouble vectors. EPSArray are six non-negative stopping thresholds; Rs ≥ 0 sets the initial trust radius (0 selects the default 100).

Defined behaviour. Returns the iteration count; X holds
the minimizer and Y the residual there. StopReason is TOptStopReason::OptResConverged when || F|| falls below EPSArray[1], or one of TOptStopReason::OptResSmallGrad,

TOptStopReason::optResSmallJacobian, TOptStopReason::OptResSmallStep,
TOptStopReason::OptResMaxIter per the MKL stop code. Building MtxVec

Core (no MKL) raises an exception; this routine is not available under .NET.

The Trust Region (TR) algorithms are relatively new iterative algorithms for solving nonlinear optimization problems. They are widely used in power engineering, finance, applied mathematics, physics, computer science, economics, sociology, biology, medicine, mechanical engineering, chemistry, and other areas. TR methods have global convergence and local super convergence, which differenciates them from line search methods and Newton methods. TR methods have better convergence when compared with widely-used Newton-type methods.

The main idea behind TR algorithm is calculating a trial step and checking if the next values of x belong to the trust region. Calculation of the trial step is strongly associated with the approximation model.

For more on TR algorithm, check the following links:

  • http://iridia.ulb.ac.be/~fvandenb/optimization/optimizationIntro.html
  • http://en.wikipedia.org/wiki/Trust_region

Note:
This function is currently not supported under .NET. The objective function calls are threaded. The objective function should not be allocating any memory on the heap because calling threads are created outside of Delphi/BCB code.

Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler

Overload 2: int TrustRegion(TMKLTRFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, tObject *CustomData, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);

#NameTypeDescription
1FunTMKLTRFunction
2JacProcTJacobianFunction
3XTVec *
4YTVec *
5CustomDatatObject *
6MaxIterint
7MaxTrialIterint
8EPSArrayconst DewArray<double> &
9Rsdouble
10StopReasonTOptStopReason &
11Control = nullTOptControl *
Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler

Overload 3: int TrustRegion(TVectorFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, TVec *LB, TVec *UB, const DewArray<double> &Consts, const DewArray<tObject *> &OConsts, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);

Trust region algorithm to find bounded minimum of vector function.

#NameTypeDescription
1FunTVectorFunction
2JacProcTJacobianFunction
3XTVec *
4YTVec *
5LBTVec *
6UBTVec *
7Constsconst DewArray<double> &
8OConstsconst DewArray<tObject *> &
9MaxIterint
10MaxTrialIterint
11EPSArrayconst DewArray<double> &
12Rsdouble
13StopReasonTOptStopReason &
14Control = nullTOptControl *
Remarks:

Additional parameters LB and UB define x lower and/or upper bounds.

Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler

Overload 4: int TrustRegion(TMKLTRFunction Fun, TJacobianFunction JacProc, TVec *X, TVec *Y, tObject *CustomData, TVec *LB, TVec *UB, int MaxIter, int MaxTrialIter, const DewArray<double> &EPSArray, double Rs, TOptStopReason &StopReason, TOptControl *Control = null);

#NameTypeDescription
1FunTMKLTRFunction
2JacProcTJacobianFunction
3XTVec *
4YTVec *
5CustomDatatObject *
6LBTVec *
7UBTVec *
8MaxIterint
9MaxTrialIterint
10EPSArrayconst DewArray<double> &
11Rsdouble
12StopReasonTOptStopReason &
13Control = nullTOptControl *
Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler