SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.univariate
Class Golden

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.univariate.BracketSearch
      extended by com.numericalmethod.suanshu.optimization.univariate.Golden

public class Golden
extends BracketSearch

Minimum finding algorithm by the golden section.

On each iteration, the algorithm compares the distances to the lower and upper ends of the bracketing interval. The bigger sub-interval is divided by the golden section (about 0.3189660...) by the next point. The value of the function at this new point is calculated and compared to the current minimum. A new bracketing interval is then chosen in the usual manner as in BracketSearch.

Choosing the golden section as the bisection ratio gives the fastest convergence among the algorithms that converge linearly.

This implementation is much simpler than that of Fibonacci. It does not run the risk that the next guess lies outside the bracketing interval.


Field Summary
 
Fields inherited from class com.numericalmethod.suanshu.optimization.univariate.BracketSearch
f, tol
 
Constructor Summary
Golden()
           
 
Method Summary
 double search(int maxIterations, double lower, double upper)
          Search for a minimum within the interval [lower, upper].
 
Methods inherited from class com.numericalmethod.suanshu.optimization.univariate.BracketSearch
minimum, search, solve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Golden

public Golden()
Method Detail

search

public double search(int maxIterations,
                     double lower,
                     double upper)
Search for a minimum within the interval [lower, upper].

Parameters:
maxIterations - number of iterations
lower - lower bound for the bracketing interval which contains a minimum
upper - upper bound for the bracketing interval which contains a minimum
Returns:
an approximate minimizer

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.