Package pal.math
Class ConjugateGradientSearch
- java.lang.Object
-
- pal.math.MultivariateMinimum
-
- 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
Fields Modifier and Type Field Description 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.0static 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
Constructors Constructor Description ConjugateGradientSearch()
ConjugateGradientSearch(int conGradStyle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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.
-
-
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 classMultivariateMinimum
- Parameters:
f
- multivariate functionx
- initial guesses for the minimum (contains the location of the minimum on return)tolfx
- absolute tolerance of function valuetolx
- 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 classMultivariateMinimum
- Parameters:
f
- multivariate functionx
- initial guesses for the minimum (contains the location of the minimum on return)tolfx
- absolute tolerance of function valuetolx
- absolute tolerance of each parametermonitor
- A monitor object that receives information about the minimising process (for display purposes)
-
-