# Bumps 0.9.1 documentation

## simplex - Nelder-Mead simplex optimizer (amoeba)

`simplex` | Minimize a function using Nelder-Mead downhill simplex algorithm.

Downhill simplex optimizer.

bumps.simplex.simplex(f, x0=None, bounds=None, radius=0.05, xtol=0.0001, ftol=0.0001, maxiter=None, update_handler=None, abort_test=<function dont_abort>)

  Minimize a function using Nelder-Mead downhill simplex algorithm.

  This optimizer is also known as Amoeba (from Numerical Recipes) and the Nealder-Mead simplex algorithm. This is not the simplex algorithm for solving constrained linear systems.

  Downhill simplex is a robust derivative free algorithm for finding minima. It proceeds by choosing a set of points (the simplex) forming an n-dimensional triangle, and transforming that triangle so that the worst vertex is improved, either by stretching, shrinking or reflecting it about the center of the triangle. This algorithm is not known for its speed, but for its simplicity and robustness, and is a good algorithm to start your problem with.

  Parameters:

  > fcallable f(x,*args)

  >   The objective function to be minimized.

  > x0ndarray

  >   Initial guess.

  > bounds(ndarray,ndarray) or None

  >   Bounds on the parameter values for the function.

  > radius: float

  >   Size of the initial simplex. For bounded parameters (those which have finite lower and upper bounds), radius is clipped to a value in (0,0.5] representing the portion of the range to use as the size of the initial simplex.

  Returns: Result (park.simplex.Result)

  > xndarray

  >   Parameter that minimizes function.

  > fxfloat

  >   Value of function at minimum: `fopt = func(xopt)`.

  > itersint

  >   Number of iterations performed.

  > callsint

  >   Number of function calls made.

  > successboolean

  >   True if fit completed successfully.

  Other Parameters:

  > xtolfloat

  >   Relative error in xopt acceptable for convergence.

  > ftolnumber

  >   Relative error in func(xopt) acceptable for convergence.

  > maxiterint=200*N

  >   Maximum number of iterations to perform. Defaults

  > update_handlercallable

  >   Called after each iteration, as callback(k,n,xk,fxk), where k is the current iteration, n is the maximum iteration, xk is the simplex and fxk is the value of the simplex vertices. xk[0],fxk[0] is the current best.

  > abort_testcallable

  >   Called after each iteration, as callback(), to see if an external process has requested stop.

  Notes

  > Uses a Nelder-Mead simplex algorithm to find the minimum of function of one or more variables.