org.apache.commons.math.optimization.package.html Maven / Gradle / Ivy
Show all versions of commons-math Show documentation
This package provides common interfaces for the optimization algorithms
provided in sub-packages. The main interfaces defines optimizers and convergence
checkers. The functions that are optimized by the algorithms provided by this
package and its sub-packages are a subset of the one defined in the analysis
package, namely the real and vector valued functions. These functions are called
objective function here. When the goal is to minimize, the functions are often called
cost function, this name is not used in this package.
Optimizers are the algorithms that will either minimize or maximize, the objective function
by changing its input variables set until an optimal set is found. There are only four
interfaces defining the common behavior of optimizers, one for each supported type of objective
function:
- {@link org.apache.commons.math.optimization.UnivariateRealOptimizer
UnivariateRealOptimizer} for {@link org.apache.commons.math.analysis.UnivariateRealFunction
univariate real functions}
- {@link org.apache.commons.math.optimization.MultivariateRealOptimizer
MultivariateRealOptimizer} for {@link org.apache.commons.math.analysis.MultivariateRealFunction
multivariate real functions}
- {@link org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer
DifferentiableMultivariateRealOptimizer} for {@link
org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction
differentiable multivariate real functions}
- {@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer
DifferentiableMultivariateVectorialOptimizer} for {@link
org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction
differentiable multivariate vectorial functions}
Despite there are only four types of supported optimizers, it is possible to optimize a
transform a {@link org.apache.commons.math.analysis.MultivariateVectorialFunction
non-differentiable multivariate vectorial function} by converting it to a {@link
org.apache.commons.math.analysis.MultivariateRealFunction non-differentiable multivariate
real function} thanks to the {@link
org.apache.commons.math.optimization.LeastSquaresConverter LeastSquaresConverter} helper class.
The transformed function can be optimized using any implementation of the {@link
org.apache.commons.math.optimization.MultivariateRealOptimizer MultivariateRealOptimizer} interface.
For each of the four types of supported optimizers, there is a special implementation which
wraps a classical optimizer in order to add it a multi-start feature. This feature call the
underlying optimizer several times in sequence with different starting points and returns
the best optimum found or all optima if desired. This is a classical way to prevent being
trapped into a local extremum when looking for a global one.