Example objectives
ConsensusBasedX.jl provides a few example functions that can be used to test the minimisation algorithms and parameters.
ConsensusBasedX.Ackley
— FunctionAckley(x::AbstractVector; a = 20, b = 0.2, c = 2π, shift = 0)
The Ackley function in dimension D = length(x)
with global minimum at the point $x = (\textrm{shift}, \textrm{shift}, \cdots, \textrm{shift})$:
\[f(x) = a \left[ 1 - \exp \left( -b \sqrt{ \frac{1}{D} \sum_{d=1}^{D} (x_d - \textrm{shift})^2 } \right) \right] + \left[ \exp(1) - \exp \left( \frac{1}{D} \sum_{d=1}^{D} \cos( c (x_d - \textrm{shift}) ) \right) \right] .\]
See also the Wikipedia article.
ConsensusBasedX.Quadratic
— FunctionQuadratic(x::AbstractVector; shift = 0)
A quadratic function in dimension D = length(x)
with global minimum at the point $x = (\textrm{shift}, \textrm{shift}, \cdots, \textrm{shift})$:
\[f(x) = \frac{1}{D} \sum_{d=1}^{D} (x_d - \textrm{shift})^2 .\]
ConsensusBasedX.Rastrigin
— FunctionRastrigin(x::AbstractVector; a = 10, c = 2π, shift = 0)
The Rastrigin function in dimension D = length(x)
with global minimum at the point $x = (\textrm{shift}, \textrm{shift}, \cdots, \textrm{shift})$:
\[f(x) = \frac{1}{D} \sum_{d=1}^{D} (x_d - \textrm{shift})^2 + a \left( 1 - \frac{1}{D} \sum_{d=1}^{D} \cos( c (x_d - \textrm{shift}) ) \right) .\]
See also the Wikipedia article.