Skip to main content
`Ctrl`+`K`

# root(method=’lm’)

scipy.optimize.root(fun, x0, args=(), method='hybr', jac=None, tol=None, callback=None, options=None)

  Solve for least squares with Levenberg-Marquardt

  See also

  For documentation for the rest of the parameters, see `scipy.optimize.root`

  Options:
    ——-
    col_deriv bool

      non-zero to specify that the Jacobian function computes derivatives down the columns (faster, because there is no transpose operation).

    ftol float

      Relative error desired in the sum of squares.

    xtol float

      Relative error desired in the approximate solution.

    gtol float

      Orthogonality desired between the function vector and the columns of the Jacobian.

    maxiter int

      The maximum number of calls to the function. If zero, then 100*(N+1) is the maximum where N is the number of elements in x0.

    eps float

      A suitable step length for the forward-difference approximation of the Jacobian (for Dfun=None). If eps is less than the machine precision, it is assumed that the relative errors in the functions are of the order of the machine precision.

    factor float

      A parameter determining the initial step bound (`factor * || diag * x||`). Should be in interval `(0.1, 100)`.

    diag sequence

      N positive entries that serve as a scale factors for the variables.