Class NelderMeadOptimizer
java.lang.Object
gda.analysis.numerical.optimization.optimizers.simplex.NelderMeadOptimizer
- All Implemented Interfaces:
IOptimizer
Nelder Mead Minimisation class
-
Constructor Summary
ConstructorsConstructorDescriptionNelderMeadOptimizer(AbstractObjectiveFunction function) Setup a neldermead optimization -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getBest()doublebooleanGet the minimisation statusdoubleSet default step size the initial points of the simplex are defaultStep*startingpointdoubleintintdoubleintintdoubledouble[]intdouble[]getSteps()Set default step size the initial points of the simplex are defaultStep*startingpointdoublebooleanvoidoptimize()voidreset()voidsetContractionCoeff(double con) Set the Nelder and Mead contraction coefficient [gamma]voidsetDefaultStep(double stepSize) Set default step size the initial points of the simplex are defaultStep*startingpointvoidsetExpansionCoefficient(double ext) Set the Nelder and Mead extension coefficient [beta]voidsetMaxNoOfIterations(int maxNoOfIterations) Set the maximum number of iterations allowed in Nelder and MeadvoidsetMaxNoOfRestarts(int nrs) Set the maximum number of restarts allowed in Nelder and MeadvoidsetReflectionCoefficient(double refl) Set the Nelder and Mead reflection coefficient [alpha]voidsetScaling(double[] sc) Set scaling factors (scalingOption 2, see above for scalingOption 0 and 1)voidsetScalingOption(int n) Reset scaling factors (scalingOption 0 and 1, see below for scalingOption 2)voidsetStartPoint(double[] startingPoint) Set the starting point...overriding the values set in the AbstractCostFunction and AbstractMultiFunctionvoidsetStepOption(int n) voidsetSteps(double[] steps) Set default step size the initial points of the simplex are defaultStep*startingpointvoidsetTolerance(double tol) Set the minimisation tolerance to tolvoidstart()Starts the optimization process....voidstop()Stops the optimization process....
-
Constructor Details
-
NelderMeadOptimizer
Setup a neldermead optimization- Parameters:
function-
-
-
Method Details
-
reset
public void reset() -
getConverganceStatus
public boolean getConverganceStatus()Get the minimisation status- Returns:
- true if convergence was achieved false if convergence not achieved before maximum number of iterations current values then returned
-
setScalingOption
public void setScalingOption(int n) Reset scaling factors (scalingOption 0 and 1, see below for scalingOption 2)- Parameters:
n- The scaling option 0 no scaling 1 intial estimates all scaled to unity
-
setStepOption
public void setStepOption(int n) - Parameters:
n-
-
getStepOption
public int getStepOption()- Returns:
- stepOption
-
setSteps
public void setSteps(double[] steps) Set default step size the initial points of the simplex are defaultStep*startingpoint- Parameters:
steps-
-
getSteps
public double[] getSteps()Set default step size the initial points of the simplex are defaultStep*startingpoint- Returns:
- the step size
-
setDefaultStep
public void setDefaultStep(double stepSize) Set default step size the initial points of the simplex are defaultStep*startingpoint- Parameters:
stepSize-
-
getDefaultStep
public double getDefaultStep()Set default step size the initial points of the simplex are defaultStep*startingpoint- Returns:
- the step size
-
setScaling
public void setScaling(double[] sc) Set scaling factors (scalingOption 2, see above for scalingOption 0 and 1)- Parameters:
sc-
-
getScaling
public double[] getScaling()- Returns:
- scaling factors
-
getBest
public double[] getBest()- Specified by:
getBestin interfaceIOptimizer- Returns:
- double array containing the values of the parameters at the minimum
-
getMinimum
public double getMinimum()- Specified by:
getMinimumin interfaceIOptimizer- Returns:
- Get the function value at minimum
-
getNoOfIterations
public int getNoOfIterations()- Returns:
- The number of iterations in Nelder and Mead
-
setMaxNoOfIterations
public void setMaxNoOfIterations(int maxNoOfIterations) Set the maximum number of iterations allowed in Nelder and Mead- Parameters:
maxNoOfIterations-
-
getMaxNoOfIterations
public int getMaxNoOfIterations()- Returns:
- The maximum number of iterations allowed in Nelder and Mead
-
getNoOfRestarts
public int getNoOfRestarts()- Returns:
- The number of restarts in Nelder and Mead
-
setMaxNoOfRestarts
public void setMaxNoOfRestarts(int nrs) Set the maximum number of restarts allowed in Nelder and Mead- Parameters:
nrs- no of restarts
-
getMaxNoOfRestarts
public int getMaxNoOfRestarts()- Returns:
- The maximum number of restarts allowed in Nelder amd Mead
-
setReflectionCoefficient
public void setReflectionCoefficient(double refl) Set the Nelder and Mead reflection coefficient [alpha]- Parameters:
refl-
-
getReflectionCoefficient
public double getReflectionCoefficient()- Returns:
- The Nelder and Mead reflection coefficient [alpha]
-
setExpansionCoefficient
public void setExpansionCoefficient(double ext) Set the Nelder and Mead extension coefficient [beta]- Parameters:
ext-
-
getExpansionCoefficient
public double getExpansionCoefficient()- Returns:
- The Nelder and Mead extension coefficient [beta]
-
setContractionCoeff
public void setContractionCoeff(double con) Set the Nelder and Mead contraction coefficient [gamma]- Parameters:
con-
-
getContractionCoeff
public double getContractionCoeff()- Returns:
- The Nelder and Mead contraction coefficient [gamma]
-
setTolerance
public void setTolerance(double tol) Set the minimisation tolerance to tol- Parameters:
tol-
-
getTolerance
public double getTolerance()- Returns:
- The minimisation tolerance
-
start
public void start()Starts the optimization process.... Creates a new thread etc........- Specified by:
startin interfaceIOptimizer
-
setStartPoint
public void setStartPoint(double[] startingPoint) Set the starting point...overriding the values set in the AbstractCostFunction and AbstractMultiFunction- Parameters:
startingPoint-
-
stop
public void stop()Stops the optimization process.... Creates a new thread etc........- Specified by:
stopin interfaceIOptimizer
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceIOptimizer
-
optimize
public void optimize()- Specified by:
optimizein interfaceIOptimizer
-