Package pal.math
Class ConjugateGradientSearch
java.lang.Object
pal.math.MultivariateMinimum
pal.math.ConjugateGradientSearch
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
FieldsModifier and TypeFieldDescriptionstatic final int
int
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 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 final int
static final int
int
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 0Fields inherited from class pal.math.MultivariateMinimum
maxFun, numFun, numFuncStops
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
FLETCHER_REEVES_UPDATE
public static final int FLETCHER_REEVES_UPDATE- See Also:
-
POLAK_RIBIERE_UPDATE
public static final int POLAK_RIBIERE_UPDATE- See Also:
-
BEALE_SORENSON_HESTENES_STIEFEL_UPDATE
public static final int BEALE_SORENSON_HESTENES_STIEFEL_UPDATE- See Also:
-
prin
public int princontrols 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 defaultStepdefaultStep 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 conjugateGradientStyleconjugateGradientStyle 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 Details
-
ConjugateGradientSearch
public ConjugateGradientSearch() -
ConjugateGradientSearch
public ConjugateGradientSearch(int conGradStyle)
-
-
Method Details
-
optimize
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)
-