Package jebl.math

Class UnivariateMinimum

java.lang.Object
jebl.math.UnivariateMinimum

public class UnivariateMinimum extends Object
minimization of a real-valued function of one variable without using derivatives.

algorithm: Brent's golden section method (Richard P. Brent. 1973. Algorithms for finding zeros and extrema of functions without calculating derivatives. Prentice-Hall.)

Version:
$Id: UnivariateMinimum.java 526 2006-11-13 20:45:42Z nut $
Author:
Korbinian Strimmer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    curvature at minimum
    double
    function value at minimum
    int
    maximum number of function evaluations (default 0 indicates no limit on calls)
    double
    last minimum
    int
    total number of function evaluations neccessary
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Find minimum (first estimate given)
    double
    findMinimum(double x, UnivariateFunction f, int fracDigits)
    Find minimum (first estimate given, desired number of fractional digits specified)
    double
    Find minimum (no first estimate given)
    double
    findMinimum(UnivariateFunction f, int fracDigits)
    Find minimum (no first estimate given, desired number of fractional digits specified)
    double
    optimize(double x, UnivariateFunction f, double tol)
    The actual optimization routine (Brent's golden section method)
    double
    optimize(double x, UnivariateFunction f, double tol, double lowerBound, double upperBound)
    The actual optimization routine (Brent's golden section method)
    double
    optimize(UnivariateFunction f, double tol)
    The actual optimization routine (Brent's golden section method)
    double
    optimize(UnivariateFunction f, double tol, double lowerBound, double upperBound)
    The actual optimization routine (Brent's golden section method)

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • minx

      public double minx
      last minimum
    • fminx

      public double fminx
      function value at minimum
    • f2minx

      public double f2minx
      curvature at minimum
    • numFun

      public int numFun
      total number of function evaluations neccessary
    • maxFun

      public int maxFun
      maximum number of function evaluations (default 0 indicates no limit on calls)
  • Constructor Details

    • UnivariateMinimum

      public UnivariateMinimum()
  • Method Details

    • findMinimum

      public double findMinimum(double x, UnivariateFunction f)
      Find minimum (first estimate given)
      Parameters:
      x - first estimate
      f - function
      Returns:
      position of minimum
    • findMinimum

      public double findMinimum(double x, UnivariateFunction f, int fracDigits)
      Find minimum (first estimate given, desired number of fractional digits specified)
      Parameters:
      x - first estimate
      f - function
      fracDigits - desired fractional digits
      Returns:
      position of minimum
    • findMinimum

      public double findMinimum(UnivariateFunction f)
      Find minimum (no first estimate given)
      Parameters:
      f - function
      Returns:
      position of minimum
    • findMinimum

      public double findMinimum(UnivariateFunction f, int fracDigits)
      Find minimum (no first estimate given, desired number of fractional digits specified)
      Parameters:
      f - function
      fracDigits - desired fractional digits
      Returns:
      position of minimum
    • optimize

      public double optimize(UnivariateFunction f, double tol, double lowerBound, double upperBound)
      The actual optimization routine (Brent's golden section method)
      Parameters:
      f - univariate function
      tol - absolute tolerance of each parameter
      lowerBound - the lower bound of input
      upperBound - the upper bound of input
      Returns:
      position of minimum
    • optimize

      public double optimize(UnivariateFunction f, double tol)
      The actual optimization routine (Brent's golden section method)
      Parameters:
      f - univariate function
      tol - absolute tolerance of each parameter
      Returns:
      position of minimum
    • optimize

      public double optimize(double x, UnivariateFunction f, double tol, double lowerBound, double upperBound)
      The actual optimization routine (Brent's golden section method)
      Parameters:
      x - initial guess
      f - univariate function
      tol - absolute tolerance of each parameter
      lowerBound - the lower bound of input
      upperBound - the upper bound of input
      Returns:
      position of minimum
    • optimize

      public double optimize(double x, UnivariateFunction f, double tol)
      The actual optimization routine (Brent's golden section method)
      Parameters:
      x - initial guess
      f - univariate function
      tol - absolute tolerance of each parameter note bounded by the given bounds of the function f
      Returns:
      position of minimum