WebCab Optimization for COM v2.6

UniDimensionalSolver.SeekNextExtremeDeriv Method 

Seeks the closest local extremum to a given initialPoint for the unidimensional differentiable object function using information from a user selected set of bracketing and location algorithms.

public double SeekNextExtremeDeriv(
   ExtremumTypes extremumType,
   double initialPoint,
   double tolerance,
   BracketingAlgorithm[] bracketingAlgorithm,
   LocateAlgorithm[] locateAlgorithm,
   int maxIterations
);

Parameters

extremumType
Indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.
initialPoint
The initial point for which the iterative search from the extremum is started from.
tolerance
The tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.
bracketingAlgorithm
The bracketing algorithm used selected from the class BracketingAlgorithm.
locateAlgorithm
The locate algorithm used selected from the class LocateAlgorithm.
maxIterations
The maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.

Return Value

the first local extremum found which is either greater than the initialPoint in the case of a maximum being sought, or less than the initialPoint in the case of the minimum being sought.

Remarks

Explanation of Approach

Unlike SeekExtremeValueUnidir and SeekExtremeUnidir which use only one pair of bracketing and locate algorithms and which can be rather imprecise. This method uses information from a set of user defined bracketing and locate algorithms, if you wish we also provide the method SeekNextExtremeDeriv, for which we have selected a collected of bracketing and location algorithms. Though the justification for this approach is heuristic in nature in many instances it leads to a improvement in the accuracy of the results found. Moreover, this approach also has the important property that the probability to miss extremum is greatly reduced.

Basic Idea and advice on applying this approach

The basic idea of this approach is that for each iteration all the algorithms chosen are invoked (even if there are duplicates) and the "best" next point of all the algorithms is used as the starting point of the next iteration. The precision used in each of the bracketing and locate algorithms should be similar (possibly even identical). The precision used should also increase as the initial point moves closer to the local extremum. In order to ensure the efficient execution of this approach certain care must be taken in the selection of the algorithms used. The reason being that for algorithms which fail for the given problem at hand though not influencing the result, will make significant computation demands during the methods execution.

Application of this Approach

Before this method is called the uni-dimensional object function of the optimization problem must be set (i.e. provided for the method) using either {@link #setFunction}, or passed using the constructor during the instantiation of the instance of the UniDimensionalSolver class. For further details, detailing exactly how the object function is implemented and then send to an instance of this class we refer the reader to SetFunction documentation. In is true that most users will find the {@link #setFunction} approach to be more user friendly, however it should be pointed out that if your application uses threads then this approach is not thread safe.

Once the object function has been set you should specify the set of bracketing and locate algorithms which are used within this method, by passing as parameters the appropriate procedures from the classs BracketingAlgorithm and LocateAlgorithm.

Finally the initialPoint from which the closest local extremum will be sought must be given. It is also necessary to provide the type of extremum sought along with the tolerance and the maximum number of iterations which can be used.

Exceptions

Exception TypeCondition
UniDimensionalExceptionThrown if the delivered function does not implement Derivative or an interface which extends Derivative.
TooManyUniDimensionalIterationsExceptionThrown if the number of iterations is grater than maxIterations.
InvalidUniDimensionalFunctionExceptionThrown if the user function returns invalid values like infinity or NaN.

See Also

UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace