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 at 0x2a0ff30>)
| source code
|
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:
- f : callable f(x,*args)
- The objective function to be minimized.
- x0 : ndarray
- 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)
- x : ndarray
- Parameter that minimizes function.
- fx : float
- Value of function at minimum: fopt = func(xopt).
- iters : int
- Number of iterations performed.
- calls : int
- Number of function calls made.
- success : boolean
- True if fit completed successfully.
Other Parameters:
- xtol : float
- Relative error in xopt acceptable for convergence.
- ftol : number
- Relative error in func(xopt) acceptable for convergence.
- maxiter : int=200*N
- Maximum number of iterations to perform. Defaults
- update_handler : callable
- Called after each iteration, as callback(xk,fxk), where xk
is the current parameter vector and fxk is the function value.
Returns True if the fit should continue.
Notes
Uses a Nelder-Mead simplex algorithm to find the minimum of
function of one or more variables.
|