This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / optimize / _minpack / _lmdif

built-in

scipy.optimize._minpack:_lmdif

Signature

built-in_lmdif(fun, x0, args, full_output, ftol, xtol, gtol, maxfev, epsfcn, factor, diag)

Summary

Levenberg-Marquardt algorithm for least squares minimization.

Extended Summary

Minimizes sum(fun(x)**2) using finite-difference Jacobian.

Parameters

fun : callable

Residual function. Takes x as first argument, returns array of residuals.

x0 : ndarray, shape (n,)

Initial guess, float64.

args : tuple

Extra arguments passed to fun.

full_output : int

Non-zero to return optional outputs.

ftol : float

Relative tolerance for residual sum of squares. Default: 1.49012e-8.

xtol : float

Relative tolerance for solution. Default: 1.49012e-8.

gtol : float

Orthogonality tolerance. Default: 0.0.

maxfev : int

Maximum number of function evaluations. Default: 200*(n+1).

epsfcn : float

Step size for finite differences. Default: 0.0 (machine precision).

factor : float

Initial step bound. Default: 100.0.

diag : ndarray, shape (n,) or None

Scaling factors for variables, float64.

Returns

x : ndarray, shape (n,)

Solution vector.

infodict : dict

Dictionary with keys: fvec (ndarray), nfev (int), fjac (ndarray), ipvt (ndarray), qtf (ndarray). Only returned if full_output != 0.

info : int

Exit status. 1-4 indicate success.

Notes

If full_output is 0: returns (x, info) If full_output != 0: returns (x, infodict, info)

Aliases

  • scipy.optimize._minpack._lmdif