Interface UnconstrainedMinimization

All Superinterfaces:
IterativeOptimization, Serializable
All Known Implementing Classes:
QuasiNewtonBFGS_to_UnconstrainedMinimization, UnconMinTrustRegionBFGS_F64

public interface UnconstrainedMinimization
extends IterativeOptimization

Optimization algorithm which seeks to minimize F(X) ∈ ℜ and X ∈ ℜN

Two convergence thresholds are specified, f-test and g-test. The f-test is a relative convergence test based on the function's value and is designed to test to see when it is near the optimal solution. G-Test is an absolute test based on the gradient's norm,

F-Test: ftol ≤ 1 - f(x+p)/f(x)
G-Test: gtol ≤ ||g(x)||inf
An absolute f-test can be done by checking the value of getFunctionValue() in each iteration.

NOTE: If you need to modify the optimization parameters this can be done inside the 'function'.

  • Method Summary

    Modifier and Type Method Description
    double getFunctionValue()
    Returns the value of the objective function being evaluated at the current parameters value.
    double[] getParameters()
    After each iteration this function can be called to get the current best set of parameters.
    void initialize​(double[] initial, double ftol, double gtol)
    Specify the initial set of parameters from which to start from.
    void setFunction​(FunctionNtoS function, FunctionNtoN gradient, double minFunctionValue)
    Specifies the function being optimized.

    Methods inherited from interface org.ddogleg.optimization.IterativeOptimization

    isConverged, isUpdated, iterate, setVerbose
  • Method Details

    • setFunction

      void setFunction​(FunctionNtoS function, FunctionNtoN gradient, double minFunctionValue)
      Specifies the function being optimized. A numerical Jacobian will be computed if null is passed in.
      Parameters:
      function - Function being optimized.
      gradient - Partial derivative for each input in the function. If null a numerical gradient will be computed.
      minFunctionValue - Minimum possible value that 'function' can have. E.g. for least squares problems this value should be set to zero.
    • initialize

      void initialize​(double[] initial, double ftol, double gtol)
      Specify the initial set of parameters from which to start from. Call after setFunction(org.ddogleg.optimization.functions.FunctionNtoS, org.ddogleg.optimization.functions.FunctionNtoN, double) has been called.
      Parameters:
      initial - Initial parameters or guess.
      ftol - Relative convergence test based on function value. 0 disables test. 0 ≤ ftol < 1, Try 1e-12
      gtol - Absolute convergence test based on gradient. 0 disables test. 0 ≤ gtol. Try 1e-12
    • getParameters

      double[] getParameters()
      After each iteration this function can be called to get the current best set of parameters.
    • getFunctionValue

      double getFunctionValue()
      Returns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.
      Returns:
      Objective function's value.