scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
fmin_powell(func, x0, args=(), xtol=0.0001, ftol=0.0001, maxiter=None, maxfun=None, full_output=0, disp=1, retall=0, callback=None, direc=None)

This method only uses function values, not derivatives.

Notes

Uses a modification of Powell's method to find the minimum of a function of N variables. Powell's method is a conjugate direction method.

The algorithm has two loops. The outer loop merely iterates over the inner loop. The inner loop minimizes over each current direction in the direction set. At the end of the inner loop, if certain conditions are met, the direction that gave the largest decrease is dropped and replaced with the difference between the current estimated x and the estimated x from the beginning of the inner-loop.

The technical conditions for replacing the direction of greatest increase amount to checking that

  1. No further gain can be made along the direction of greatest increase from that iteration.

  2. The direction of greatest increase accounted for a large sufficient fraction of the decrease in the function value from that iteration of the inner loop.

Parameters

func : callable f(x,*args)

Objective function to be minimized.

x0 : ndarray

Initial guess.

args : tuple, optional

Extra arguments passed to func.

xtol : float, optional

Line-search error tolerance.

ftol : float, optional

Relative error in func(xopt) acceptable for convergence.

maxiter : int, optional

Maximum number of iterations to perform.

maxfun : int, optional

Maximum number of function evaluations to make.

full_output : bool, optional

If True, fopt , xi , direc , iter , funcalls , and warnflag are returned.

disp : bool, optional

If True, print convergence messages.

retall : bool, optional

If True, return a list of the solution at each iteration.

callback : callable, optional

An optional user-supplied function, called after each iteration. Called as callback(xk) , where xk is the current parameter vector.

direc : ndarray, optional

Initial fitting step and parameter order set as an (N, N) array, where N is the number of fitting parameters in :None:None:`x0`. Defaults to step size 1.0 fitting all parameters simultaneously ( np.eye((N, N)) ). To prevent initial consideration of values in a step or to change initial step size, set to 0 or desired step size in the Jth position in the Mth block, where J is the position in :None:None:`x0` and M is the desired evaluation step, with steps being evaluated in index order. Step size and ordering will change freely as minimization proceeds.

Returns

xopt : ndarray

Parameter which minimizes :None:None:`func`.

fopt : number

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

direc : ndarray

Current direction set.

iter : int

Number of iterations.

funcalls : int

Number of function calls made.

warnflag : int
allvecs : list

List of solutions at each iteration.

Minimize a function using modified Powell's method.

See Also

minimize

Interface to unconstrained minimization algorithms for multivariate functions. See the 'Powell' method in particular.

Examples

>>> def f(x):
...  return x**2
>>> from scipy import optimize
>>> minimum = optimize.fmin_powell(f, -1)
Optimization terminated successfully.
         Current function value: 0.000000
         Iterations: 2
         Function evaluations: 18
>>> minimum
array(0.0)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.optimize._optimize.fmin_powell

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_optimize.py#2949
type: <class 'function'>
Commit: