java.lang.Object
gda.analysis.numerical.optimization.optimizers.leastsquares.minpackOptimizer
All Implemented Interfaces:
IOptimizer

public class minpackOptimizer extends Object implements IOptimizer

This class contains Java translations of the MINPACK nonlinear least squares routines. As of November 2000,

The original FORTRAN MINPACK package was produced by Burton S. Garbow, Kenneth E. Hillstrom, and Jorge J. More as part of the Argonne National Laboratory MINPACK project, March 1980.

  • Constructor Details

    • minpackOptimizer

      public minpackOptimizer(chisquared function)
      Parameters:
      function -
  • Method Details

    • reset

      public void reset()
    • setMaxNoOfEvaluations

      public void setMaxNoOfEvaluations(int maxNoOfFunctionEvaluations)
      Parameters:
      maxNoOfFunctionEvaluations -
    • getMaxNoOfEvaluations

      public int getMaxNoOfEvaluations()
      Returns:
      Max no of function evaluations allowed
    • setxTolerance

      public void setxTolerance(double xTolerance)
      Parameters:
      xTolerance -
    • getxTolerance

      public double getxTolerance()
      Returns:
      Termination occurs when the relative error between two consecutive iterates is at most xTolerance.
    • setfTolerance

      public void setfTolerance(double fTolerance)
      Termination occurs when both the actual and predicted relative reductions in the sum of squares are at most fTolerance. Therefore, fTolerance measures the relative error desired in the sum of squares.
      Parameters:
      fTolerance -
    • getfTolerance

      public double getfTolerance()
      Returns:
      Termination occurs when both the actual and predicted relative reductions in the sum of squares are at most fTolerance. Therefore, fTolerance measures the relative error desired in the sum of squares.
    • setgTolerance

      public void setgTolerance(double gTolerance)
      Parameters:
      gTolerance - Termination occurs when the cosine of the angle between functionAtDataPoints and any column of the Jacobian is at most gTolerance in absolute value. Therefore, gTolerance measures the orthogonality desired between the function vector and the columns of the Jacobian.
    • getgTolerance

      public double getgTolerance()
      Termination occurs when the cosine of the angle between functionAtDataPoints and any column of the Jacobian is at most gTolerance in absolute value. Therefore, gTolerance measures the orthogonality desired between the function vector and the columns of the Jacobian.
      Returns:
      gTolerance
    • setFactor

      public void setFactor(double factor)
      Parameters:
      factor - A positive input variable used in determining the initial step bound. This bound is set to the product of factor and the euclidean norm of diag*x if non 0.0, or else to factor itself. In most cases factor should lie in the interval (.1,100). 100 is a generally recommended value.
    • getFactor

      public double getFactor()
      A positive input variable used in determining the initial step bound. This bound is set to the product of factor and the euclidean norm of diag*x if non 0.0, or else to factor itself. In most cases factor should lie in the interval (.1,100). 100 is a generally recommended value.
      Returns:
      factor
    • setScaling

      public void setScaling(double[] scaling)
      Parameters:
      scaling -
    • unsetScaling

      public void unsetScaling()
    • optimize

      public void optimize()
      Specified by:
      optimize in interface IOptimizer
    • start

      public void start()
      Starts the optimization process.... Creates a new thread etc........
      Specified by:
      start in interface IOptimizer
    • stop

      public void stop()
      Stop the thread....
      Specified by:
      stop in interface IOptimizer
    • getBest

      public double[] getBest()
      Specified by:
      getBest in interface IOptimizer
      Returns:
      the best parameters
    • getMinimum

      public double getMinimum()
      Specified by:
      getMinimum in interface IOptimizer
      Returns:
      the current minimum
    • getInfo

      public int getInfo()
      Returns:
      info An integer output variable. info is set as follows.

      info = 0 improper input parameters

      info = 1 algorithm estimates that the relative error in the sum of squares is at most tol.

      info = 2 algorithm estimates that the relative error between x and the solution is at most tol.

      info = 3 conditions for info = 1 and info = 2 both hold

      info = 4 functionAtDataPoints is orthogonal to the columns of the Jacobian to machine precision.

      info = 5 number of calls to fcn has reached or exceeded 200*(noOfParameters+1)

      info = 6 tol is too small. No further reduction in the sum of squares is possible.

      info = 7 tol is too small. No further improvement in the approximate solution x is possible.

      info = 9 Thread stopped

    • getNoOfParameters

      public int getNoOfParameters()
      Returns:
      No of parameters...just a consistency check
    • getNoOfObservations

      public int getNoOfObservations()
      Returns:
      No of observations or data points...just a consistency check
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface IOptimizer