e04jc 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 method 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 .
Syntax
C# |
---|
public static void e04jc( E04..::..E04JC_OBJFUN objfun, int n, int npt, double[] x, double[] bl, double[] bu, double rhobeg, double rhoend, E04..::..E04JC_MONFUN monfun, int maxcal, out double f, out int nf, out int ifail ) |
Visual Basic |
---|
Public Shared Sub e04jc ( _ objfun As E04..::..E04JC_OBJFUN, _ n As Integer, _ npt As Integer, _ x As Double(), _ bl As Double(), _ bu As Double(), _ rhobeg As Double, _ rhoend As Double, _ monfun As E04..::..E04JC_MONFUN, _ maxcal As Integer, _ <OutAttribute> ByRef f As Double, _ <OutAttribute> ByRef nf As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void e04jc( E04..::..E04JC_OBJFUN^ objfun, int n, int npt, array<double>^ x, array<double>^ bl, array<double>^ bu, double rhobeg, double rhoend, E04..::..E04JC_MONFUN^ monfun, int maxcal, [OutAttribute] double% f, [OutAttribute] int% nf, [OutAttribute] int% ifail ) |
F# |
---|
static member e04jc : objfun : E04..::..E04JC_OBJFUN * n : int * npt : int * x : float[] * bl : float[] * bu : float[] * rhobeg : float * rhoend : float * monfun : E04..::..E04JC_MONFUN * maxcal : int * f : float byref * nf : int byref * ifail : int byref -> unit |
Parameters
- objfun
- Type: NagLibrary..::..E04..::..E04JC_OBJFUNobjfun must evaluate the objective function at a specified vector .
A delegate of type E04JC_OBJFUN.
- n
- Type: System..::..Int32On entry: , the number of independent variables.Constraint: and , where denotes the number of non-fixed variables.
- npt
- Type: System..::..Int32On 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.
- x
- Type: array<System..::..Double>[]()[][]An array of size [n]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 on exit, x is the position of the minimum.
- bl
- Type: array<System..::..Double>[]()[][]An array of size [n]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 x02al).Constraints:
- if is to be fixed at , then ;
- otherwise , for .
- bu
- Type: array<System..::..Double>[]()[][]An array of size [n]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 x02al).Constraints:
- if is to be fixed at , then ;
- otherwise , for .
- rhobeg
- Type: System..::..DoubleOn 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:
- ;
- .
- rhoend
- Type: System..::..DoubleOn 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: .
- monfun
- Type: NagLibrary..::..E04..::..E04JC_MONFUNmonfun 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 the dummy monitoring method E04JCP supplied by the NAG Library.
A delegate of type E04JC_MONFUN.
- maxcal
- Type: System..::..Int32On entry: the maximum permitted number of calls to objfun.Constraint: .
- f
- Type: System..::..Double%On exit: the function value at the lowest point found (x).
- nf
- Type: System..::..Int32%On exit: unless or on exit, the total number of calls made to objfun.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
e04jc 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 e04jc.
You must supply a method to calculate the value of at any given point .
The method used by e04jc is based on BOBYQA, the method of Bound Optimization BY Quadratic Approximation described in Powell (2009). In particular, each iteration of e04jc 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 http://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf
Error Indicators and Warnings
Errors or warnings detected by the method:
- An input parameter is invalid.
- You terminated the solver.
- Internal memory allocation failed.
Accuracy
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.
Parallelism and Performance
None.
Further Comments
For each invocation of e04jc, local workspace arrays of fixed length are allocated internally. The total size of these arrays amounts to real 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 .
Example
This example involves the minimization of
subject to
starting from the initial guess .