Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scipy.optimize.fsolve Jacobian argument incomplete in the documentation #7126

Closed
gautamdivgi opened this issue Mar 3, 2017 · 0 comments
Closed
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.optimize

Comments

@gautamdivgi
Copy link

gautamdivgi commented Mar 3, 2017

This seems to be a minor documentation bug & an easy fix

The scipy.optimize.fsolve accepts a jacobian in the fprime argument

scipy.optimize.fsolve(func, x0, args=(), fprime=None, full_output=0, col_deriv=0, xtol=1.49012e-08, maxfev=0, band=None, epsfcn=None, factor=100, diag=None)

fprime is defined as

fprime : callable(x), optional A function to compute the Jacobian offuncwith derivatives across the rows. By default, the Jacobian will be estimated.

I believe it should really be

fprime : callable(x, *args), optional A function to compute the Jacobian offuncwith derivatives across the rows. By default, the Jacobian will be estimated.

The args from fsolve are passed down to the jacobian. This can be confirmed from the code in scipy/optimize/minpack.py, _root_hybr (code snippet below - the last line is where there is check to see if the jacobian accepts x0 & args)

` Dfun = jac

if Dfun is None:

    if band is None:

        ml, mu = -10, -10

    else:

        ml, mu = band[:2]

    if maxfev == 0:

        maxfev = 200 * (n + 1)

    retval = _minpack._hybrd(func, x0, args, 1, xtol, maxfev,
                             ml, mu, epsfcn, factor, diag)

else:

    _check_func('fsolve', 'fprime', Dfun, x0, args, n, (n, n))

`

@pv pv added Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.optimize labels Mar 25, 2017
adivijaykumar added a commit to adivijaykumar/scipy that referenced this issue Apr 14, 2017
@dlax dlax closed this as completed in 50d8463 Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.optimize
Projects
None yet
Development

No branches or pull requests

2 participants