bundles / scipy 1.17.1 / scipy / optimize / _optimize / fmin_powell
function
scipy.optimize._optimize:fmin_powell
Signature
def 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 ) Summary
Minimize a function using modified Powell's method.
Extended Summary
This method only uses function values, not derivatives.
Parameters
func: callable f(x,*args)Objective function to be minimized.
x0: ndarrayInitial guess.
args: tuple, optionalExtra arguments passed to func.
xtol: float, optionalLine-search error tolerance.
ftol: float, optionalRelative error in
func(xopt)acceptable for convergence.maxiter: int, optionalMaximum number of iterations to perform.
maxfun: int, optionalMaximum number of function evaluations to make.
full_output: bool, optionalIf True,
fopt,xi,direc,iter,funcalls, andwarnflagare returned.disp: bool, optionalIf True, print convergence messages.
retall: bool, optionalIf True, return a list of the solution at each iteration.
callback: callable, optionalAn optional user-supplied function, called after each iteration. Called as
callback(xk), wherexkis the current parameter vector.direc: ndarray, optionalInitial fitting step and parameter order set as an (N, N) array, where N is the number of fitting parameters in
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 inx0and 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: ndarrayParameter which minimizes
func.fopt: numberValue of function at minimum:
fopt = func(xopt).direc: ndarrayCurrent direction set.
iter: intNumber of iterations.
funcalls: intNumber of function calls made.
warnflag: intInteger warning flag:
1Maximum number of function evaluations. 2 : Maximum number of iterations. 3 : NaN result encountered. 4 : The result is out of the provided bounds.
allvecs: listList of solutions at each iteration.
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
No further gain can be made along the direction of greatest increase from that iteration.
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.
Examples
def f(x): return x**2✓
from scipy import optimize
✓minimum = optimize.fmin_powell(f, -1)
✓minimum
✗See also
- minimize
Interface to unconstrained minimization algorithms for multivariate functions. See the 'Powell' method in particular.
Aliases
-
scipy.optimize.fmin_powell