|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.optimization.MultiStartDifferentiableMultivariateVectorialOptimizer
public class MultiStartDifferentiableMultivariateVectorialOptimizer
Special implementation of the DifferentiableMultivariateVectorialOptimizer interface adding
multi-start features to an existing optimizer.
This class wraps a classical optimizer to use it several times in turn with different starting points in order to avoid being trapped into a local extremum when looking for a global one.
| Constructor Summary | |
|---|---|
MultiStartDifferentiableMultivariateVectorialOptimizer(DifferentiableMultivariateVectorialOptimizer optimizer,
int starts,
RandomVectorGenerator generator)
Create a multi-start optimizer from a single-start optimizer |
|
| Method Summary | |
|---|---|
VectorialConvergenceChecker |
getConvergenceChecker()
Get the convergence checker. |
int |
getEvaluations()
Get the number of evaluations of the objective function. |
int |
getIterations()
Get the number of iterations realized by the algorithm. |
int |
getJacobianEvaluations()
Get the number of evaluations of the objective function jacobian . |
int |
getMaxEvaluations()
Get the maximal number of functions evaluations. |
int |
getMaxIterations()
Get the maximal number of iterations of the algorithm. |
VectorialPointValuePair[] |
getOptima()
Get all the optima found during the last call to optimize. |
VectorialPointValuePair |
optimize(DifferentiableMultivariateVectorialFunction f,
double[] target,
double[] weights,
double[] startPoint)
Optimizes an objective function. |
void |
setConvergenceChecker(VectorialConvergenceChecker checker)
Set the convergence checker. |
void |
setMaxEvaluations(int maxEvaluations)
Set the maximal number of functions evaluations. |
void |
setMaxIterations(int maxIterations)
Set the maximal number of iterations of the algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiStartDifferentiableMultivariateVectorialOptimizer(DifferentiableMultivariateVectorialOptimizer optimizer,
int starts,
RandomVectorGenerator generator)
optimizer - single-start optimizer to wrapstarts - number of starts to perform (including the
first one), multi-start is disabled if value is less than or
equal to 1generator - random vector generator to use for restarts| Method Detail |
|---|
public VectorialPointValuePair[] getOptima()
throws IllegalStateException
optimize.
The optimizer stores all the optima found during a set of
restarts. The optimize method returns the
best point only. This method returns all the points found at the
end of each starts, including the best one already returned by the optimize method.
The returned array as one element for each start as specified
in the constructor. It is ordered with the results from the
runs that did converge first, sorted from best to worst
objective value (i.e in ascending order if minimizing and in
descending order if maximizing), followed by and null elements
corresponding to the runs that did not converge. This means all
elements will be null if the optimize method did throw a ConvergenceException).
This also means that if the first element is non null, it is the best
point found across all starts.
IllegalStateException - if optimize has not been calledpublic void setMaxIterations(int maxIterations)
setMaxIterations in interface DifferentiableMultivariateVectorialOptimizermaxIterations - maximal number of function calls
.public int getMaxIterations()
getMaxIterations in interface DifferentiableMultivariateVectorialOptimizerpublic int getIterations()
getIterations in interface DifferentiableMultivariateVectorialOptimizerpublic void setMaxEvaluations(int maxEvaluations)
setMaxEvaluations in interface DifferentiableMultivariateVectorialOptimizermaxEvaluations - maximal number of function evaluationspublic int getMaxEvaluations()
getMaxEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic int getEvaluations()
The number of evaluation correspond to the last call to the
optimize method. It is 0 if
the method has not been called yet.
getEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic int getJacobianEvaluations()
The number of evaluation correspond to the last call to the
optimize method. It is 0 if
the method has not been called yet.
getJacobianEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic void setConvergenceChecker(VectorialConvergenceChecker checker)
setConvergenceChecker in interface DifferentiableMultivariateVectorialOptimizerchecker - object to use to check for convergencepublic VectorialConvergenceChecker getConvergenceChecker()
getConvergenceChecker in interface DifferentiableMultivariateVectorialOptimizer
public VectorialPointValuePair optimize(DifferentiableMultivariateVectorialFunction f,
double[] target,
double[] weights,
double[] startPoint)
throws FunctionEvaluationException,
OptimizationException,
IllegalArgumentException
Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is ∑weighti(objectivei-targeti)2
optimize in interface DifferentiableMultivariateVectorialOptimizerf - objective functiontarget - target value for the objective functions at optimumweights - weight for the least squares cost computationstartPoint - the start point for optimization
FunctionEvaluationException - if the objective function throws one during
the search
OptimizationException - if the algorithm failed to converge
IllegalArgumentException - if the start point dimension is wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||