[SciPy-User] ftol and xtol
Sat Jul 6 02:32:05 CDT 2013
If one uses relative error, it is unclear how to handle the situation where
the minimum is at zero. So, absolute error seems more practical.
On Fri, Jul 5, 2013 at 4:38 AM, GRBChaser [via Scipy-User] <
> On the subject of ftol and xtol, the help for fmin describes these
> parameters as :
> xtol : float
> Relative error in xopt acceptable for convergence.
> ftol : number
> Relative error in func(xopt) acceptable for convergence.
> The use of the word "Relative" here has always implied to me that the
> convergence tests calculated by fmin refer to fractional changes in
> parameters or function values. However, I had difficulties trying to
> minimize a function in which the two parameters defer by many orders or
> magnitude (e.g. 1 and 1e10) and I've come to the conclusion it is because
> the large parameter never passes the convergence test.
> The code in fmin which tests for convergence is :
> if (max(numpy.ravel(abs(sim[1:]-sim))) <= xtol \
> and max(abs(fsim-fsim[1:])) <= ftol):
> This does not look like a test for the relative change in parameters or
> function values to me, but rather a test for their absolute changes. A
> relative change would surely be something like
> if (max(numpy.ravel(abs((sim[1:]-sim)/sim))) <= xtol \
> and max(abs((fsim-fsim[1:])/fsim)) <= ftol):
> (though care should really be taken for possible divide by zero errors).
> Either the docstring needs changing so "Relative" is replaced with
> "Absolute" to make it clear, or the convergence test needs to be changed so
> it truly is a relative error test.
> If you reply to this email, your message will be added to the discussion
> To unsubscribe from ftol and xtol, click here<http://scipy-user.10969.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=18355&code=UGhpbGxpcC5NLkZlbGRtYW5AZ21haWwuY29tfDE4MzU1fC0zOTE4NzA0MQ==>
View this message in context: http://scipy-user.10969.n7.nabble.com/ftol-and-xtol-tp18355p18520.html
Sent from the Scipy-User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User