dwvisser.statistics
Class BrentMethod

java.lang.Object
  |
  +--dwvisser.statistics.BrentMethod

public class BrentMethod
extends java.lang.Object

This class is based on the routine brent in Numerical Recipes in C, 2nd ed. It is for finding a function minimum given values known to bracket it.


Constructor Summary
BrentMethod(Function f)
          Creates an instance of BrentMethod with the function f.
 
Method Summary
 double xmin(double ax, double bx, double cx, double tol)
          Find minimum of the function in the interval given to a certain tolerance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrentMethod

public BrentMethod(Function f)
Creates an instance of BrentMethod with the function f.

Parameters:
f - the function to minimize
Method Detail

xmin

public double xmin(double ax,
                   double bx,
                   double cx,
                   double tol)
            throws StatisticsException
Find minimum of the function in the interval given to a certain tolerance.

Parameters:
ax - one endpoint of initial bracket
bx - initial guess between bracket limits, f(bx)cx - other endpoint of initial bracket
tol - fractional precision to which minimum is to be found
Returns:
value at which function is minimized
StatisticsException