Documentation of 'jsat.math.optimization.NelderMead' Java class
NelderMead
jsat.math.optimization

Class NelderMead

  • All Implemented Interfaces:
    Optimizer


    public class NelderMead
    extends java.lang.Object
    implements Optimizer
    The Nelder-Mean algorithm is a simple directed search method. As such, it does not need any information about the target functions derivative, or any data points. To perform best, the Nelder-Mean method needs N+1 reasonable initial guesses for an N dimensional problem.
    The Nelder-Mean method has the advantage that the only information it needs about the function it is going to minimize, is the function itself.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      NelderMead clone() 
      int getMaximumIterations()
      Returns the maximum number of iterations to perform
      Vec optimize(double eps, int iterationLimit, Function f, java.util.List<Vec> initalPoints, boolean parallel)
      Attempts to find the minimal value of the given function.
      void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, boolean parallel)
      Attempts to optimize the given function by finding the value of w that will minimize the value returned by f(w), using w = x0 as an initial starting point.
      void setContraction(double contraction)
      Sets the contraction constant, which must be in the range (0, 1)
      void setExpansion(double expansion)
      Sets the expansion constant, which must be greater than 1 and the reflection constant
      void setMaximumIterations(int iterations)
      Sets the maximum number of iterations allowed for the optimization method
      void setReflection(double reflection)
      Sets the reflection constant, which must be greater than 0
      void setShrink(double shrink)
      Sets the shrinkage constant, which must be in the range (0, 1)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NelderMead

        public NelderMead()
      • NelderMead

        public NelderMead(NelderMead toCopy)
    • Method Detail

      • setReflection

        public void setReflection(double reflection)
        Sets the reflection constant, which must be greater than 0
        Parameters:
        reflection - the reflection constant
      • setExpansion

        public void setExpansion(double expansion)
        Sets the expansion constant, which must be greater than 1 and the reflection constant
        Parameters:
        expansion -
      • setContraction

        public void setContraction(double contraction)
        Sets the contraction constant, which must be in the range (0, 1)
        Parameters:
        contraction - the contraction constant
      • setShrink

        public void setShrink(double shrink)
        Sets the shrinkage constant, which must be in the range (0, 1)
        Parameters:
        shrink -
      • optimize

        public void optimize(double tolerance,
                             Vec w,
                             Vec x0,
                             Function f,
                             FunctionVec fp,
                             boolean parallel)
        Description copied from interface: Optimizer
        Attempts to optimize the given function by finding the value of w that will minimize the value returned by f(w), using w = x0 as an initial starting point.
        Specified by:
        optimize in interface Optimizer
        Parameters:
        tolerance - the value that the gradient norm must be less than to consider converged
        w - the the location to store the final solution
        x0 - the initial guess for the solution. This value will not be changed, and intermediate matrices will be created as the same type.
        f - the objective function to minimizer
        fp - the derivative of the objective function, may be null depending on the optimizer
        parallel - true if multiple threads should be used for optimization, or false if a single thread should be used.
      • optimize

        public Vec optimize(double eps,
                            int iterationLimit,
                            Function f,
                            java.util.List<Vec> initalPoints,
                            boolean parallel)
        Attempts to find the minimal value of the given function.
        Parameters:
        eps - the desired accuracy of the result.
        iterationLimit - the maximum number of iteration steps to allow. This value must be positive
        f - the function to optimize. This value can not be null
        initalPoints - the list of initial guess points. If too small, new ones will be generated. if too large, the extra ones will be ignored. This list may not be empty
        parallel - true if multiple threads should be used for optimization, or false if a single thread should be used.
        Returns:
        the computed value for the optimization.
      • setMaximumIterations

        public void setMaximumIterations(int iterations)
        Description copied from interface: Optimizer
        Sets the maximum number of iterations allowed for the optimization method
        Specified by:
        setMaximumIterations in interface Optimizer
        Parameters:
        iterations - the maximum number of iterations to perform
      • getMaximumIterations

        public int getMaximumIterations()
        Description copied from interface: Optimizer
        Returns the maximum number of iterations to perform
        Specified by:
        getMaximumIterations in interface Optimizer
        Returns:
        the maximum number of iterations to perform
      • clone

        public NelderMead clone()
        Specified by:
        clone in interface Optimizer
        Overrides:
        clone in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.