Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

4.1 First example: gradient-free optimization and the Nelder-Mead algorithm

A first example that relies only on being able to evaluate f0(x)f_0(x) is the Nelder-Mead algorithm.

General idea

The general idea of the algorithm is summarized below.

The Wikipedia page describes in more details the operations performed on the simplex and in which situation they occur.

Examples

The following python code implements and demonstrate the Nelder mead algorithm on the Himmelblau test function has been adapted from Wikimedia [1]

Source
Loading...

For this choice of initial points, the Nelder-Mead algorithm converges to one of the four local minimizers of the Himmelblau function.

Let us choose different initial points.

Source
Loading...

The algorithm now converges to a different local optima! Last example:

Source
Loading...

In this last case, the Nelder-Mead algorithm gets trapped in the valley surrounding local optima, and does not converge. This is one of the limitations of the algorithm: despite its simplicity, little can be said about its convergence properties (in the sense that it is not possible to guarantee that it will be able to find a local optima of the minimisation problem).

In the reminder of the chapter, we’ll turn our attention to descent methods, i.e., methods that exploit first-order (gradient of f0f_0) and second-order properties (Hessian of f0f_0) to construct sequences that iteratively decrease the value of the cost function f0f_0.

Footnotes
  1. Nicoguaro, CC BY 4.0 https://creativecommons.org/licenses/by/4.0, via Wikimedia Commons