pal.math
Class ConjugateGradientSearch

java.lang.Object
  extended by pal.math.MultivariateMinimum
      extended by pal.math.ConjugateGradientSearch

public class ConjugateGradientSearch
extends MultivariateMinimum

minimization of a real-valued function of several variables using a the nonlinear conjugate gradient method where several variants of the direction update are available (Fletcher-Reeves, Polak-Ribiere, Beale-Sorenson, Hestenes-Stiefel) and bounds are respected. Gradients are computed numerically if they are not supplied by the user. The line search is entirely based on derivative evaluation, similar to the strategy used in macopt (Mackay).

Version:
$Id: ConjugateGradientSearch.java,v 1.7 2002/10/27 05:46:28 matt Exp $
Author:
Korbinian Strimmer

Nested Class Summary
 
Nested classes/interfaces inherited from class pal.math.MultivariateMinimum
MultivariateMinimum.Factory
 
Field Summary
static int BEALE_SORENSON_HESTENES_STIEFEL_UPDATE
           
 int conjugateGradientStyle
          conjugateGradientStyle determines the method for the conjugate gradient direction update update (0 -> Fletcher-Reeves, 1 -> Polak-Ribiere, 2 -> Beale-Sorenson, Hestenes-Stiefel), the default is 2.
 double defaultStep
          defaultStep is a steplength parameter and should be set equal to the expected distance from the solution (in a line search) exceptionally small or large values of defaultStep lead to slower convergence on the first few iterations (the step length itself is adapted during search), the default value is 1.0
static int FLETCHER_REEVES_UPDATE
           
static int POLAK_RIBIERE_UPDATE
           
 int prin
          controls the printed output from the routine (0 -> no output, 1 -> print only starting and final values, 2 -> detailed map of the minimisation process), the default value is 0
 
Fields inherited from class pal.math.MultivariateMinimum
maxFun, numFun, numFuncStops
 
Constructor Summary
ConjugateGradientSearch()
           
ConjugateGradientSearch(int conGradStyle)
           
 
Method Summary
 void optimize(MultivariateFunction f, double[] x, double tolfx, double tolx)
          The actual optimization routine (needs to be implemented in a subclass of MultivariateMinimum).
 void optimize(MultivariateFunction f, double[] x, double tolfx, double tolx, MinimiserMonitor monitor)
          The actual optimization routine It finds a minimum close to vector x when the absolute tolerance for each parameter is specified.
 
Methods inherited from class pal.math.MultivariateMinimum
copy, findMinimum, findMinimum, findMinimum, stopCondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLETCHER_REEVES_UPDATE

public static final int FLETCHER_REEVES_UPDATE
See Also:
Constant Field Values

POLAK_RIBIERE_UPDATE

public static final int POLAK_RIBIERE_UPDATE
See Also:
Constant Field Values

BEALE_SORENSON_HESTENES_STIEFEL_UPDATE

public static final int BEALE_SORENSON_HESTENES_STIEFEL_UPDATE
See Also:
Constant Field Values

prin

public int prin
controls the printed output from the routine (0 -> no output, 1 -> print only starting and final values, 2 -> detailed map of the minimisation process), the default value is 0


defaultStep

public double defaultStep
defaultStep is a steplength parameter and should be set equal to the expected distance from the solution (in a line search) exceptionally small or large values of defaultStep lead to slower convergence on the first few iterations (the step length itself is adapted during search), the default value is 1.0


conjugateGradientStyle

public int conjugateGradientStyle
conjugateGradientStyle determines the method for the conjugate gradient direction update update (0 -> Fletcher-Reeves, 1 -> Polak-Ribiere, 2 -> Beale-Sorenson, Hestenes-Stiefel), the default is 2.

Constructor Detail

ConjugateGradientSearch

public ConjugateGradientSearch()

ConjugateGradientSearch

public ConjugateGradientSearch(int conGradStyle)
Method Detail

optimize

public void optimize(MultivariateFunction f,
                     double[] x,
                     double tolfx,
                     double tolx)
Description copied from class: MultivariateMinimum
The actual optimization routine (needs to be implemented in a subclass of MultivariateMinimum). It finds a minimum close to vector x when the absolute tolerance for each parameter is specified.

Specified by:
optimize in class MultivariateMinimum
Parameters:
f - multivariate function
x - initial guesses for the minimum (contains the location of the minimum on return)
tolfx - absolute tolerance of function value
tolx - absolute tolerance of each parameter

optimize

public void optimize(MultivariateFunction f,
                     double[] x,
                     double tolfx,
                     double tolx,
                     MinimiserMonitor monitor)
Description copied from class: MultivariateMinimum
The actual optimization routine It finds a minimum close to vector x when the absolute tolerance for each parameter is specified.

Overrides:
optimize in class MultivariateMinimum
Parameters:
f - multivariate function
x - initial guesses for the minimum (contains the location of the minimum on return)
tolfx - absolute tolerance of function value
tolx - absolute tolerance of each parameter
monitor - A monitor object that receives information about the minimising process (for display purposes)