[SciPy-Dev] Doc error in scipy.optimize.fmin and missing info in ref guide

David Goldsmith d.l.goldsmith at gmail.com
Fri Mar 19 15:16:29 EDT 2010


On Mon, Mar 15, 2010 at 4:05 PM, Rob Clewley <rob.clewley at gmail.com> wrote:
> Hi,
>
> In both my old version and the one in the svn trunk there is an
> inconsistency in the docstring of scipy.optimize.fmin.
>
>    Other Parameters
>    ----------------
>    xtol : float
>        Relative error in xopt acceptable for convergence.
>    ftol : number
>        Relative error in func(xopt) acceptable for convergence.
>
> As you see from the following code snippet from the body of the
> function, the convergence test is in terms of absolute error for both
> x and f, as the sim array contains x values and fsim the function
> values.
>
>    if (max(numpy.ravel(abs(sim[1:]-sim[0]))) <= xtol \
>                and max(abs(fsim[0]-fsim[1:])) <= ftol):
>        break

OK, folks, so what's the _desired_ behavior: absolute or relative
error (i.e., where's the bug: in the code or in the doc)?

DG



More information about the SciPy-Dev mailing list