.. _cma_es: Global minimization of a non-expensive scalar function with discrete parameters ========================================================================================== :Driver: :ref:`CMAES` :Download script: :download:`cma_es.py` The target of the study is to minimize a scalar function. The scalar function is assumed to be inexpensive to evaluate (i.e. evaluation time shorter than a second) and to have *no* known derivatives. In this case a heuristic global optimization is advisable. CMA-ES is an evolutionary optimization algorithm that draws population members from a multivariate Gaussian distribution. As an example, a 3D `Rastrigin-like function `_ on a mixed circular and discrete domain is minimized, .. math:: &\text{min.}\,& f(x_1,x_2,x_3) = 3\cdot10 + \sum_{i=1}^3 \left(x_i^2 - 10\cos(2\pi x_i)\right) &\text{s.t.}\,& \sqrt{x_1^2 + x_2^2} \leq 1.5 \wedge x_3 \in \{-1,0,1\}. .. literalinclude:: ./cma_es.py :language: python :linenos: