#2607: find_minimum_on_interval() uses the wrong scipy function
-------------------------------------------------+--------------------------
Reporter: AlexGhitza | Owner: jwmerrill
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.1
Component: calculus | Resolution:
Keywords: sd31, sd40.5 | Work issues:
Report Upstream: N/A | Reviewers: Karl-Dieter
Crisman, Mike Hansen
Authors: Dan Drake, Andrey Novoseltsev | Merged in:
Dependencies: sage-5.1.beta2 | Stopgaps:
-------------------------------------------------+--------------------------
Changes (by aginiewicz):
* status: needs_work => needs_review
Old description:
> This was reported by Dean Moore on sage-support. Consider:
>
> {{{
> sage: f(x) = -x*sin(x^2)
> sage: f.find_minimum_on_interval(-2.5, 2)
> (-1.3076194129914434, 1.35521114057)
> sage: f.find_minimum_on_interval(-2.5, -1)
> (-2.1827697846777219, -2.19450274985)
> }}}
>
> So find_minimum_on_interval() returns a local minimum as opposed to the
> global one. (The same issue applies to find_maximum_on_interval.) This
> is due to the fact that the function wraps scipy.optimize.fminbound,
> which is only a local optimizer (Carl Witty pointed this out). We should
> instead use one of the global optimizers, i.e. scipy.optimize.anneal or
> scipy.optimize.brute.
>
> '''Apply:'''
> * [attachment:trac2607.patch]
> * [attachment:trac2607-whitespace.patch]
> * [attachment:trac_2607_renaming.2.patch]
New description:
This was reported by Dean Moore on sage-support. Consider:
{{{
sage: f(x) = -x*sin(x^2)
sage: f.find_minimum_on_interval(-2.5, 2)
(-1.3076194129914434, 1.35521114057)
sage: f.find_minimum_on_interval(-2.5, -1)
(-2.1827697846777219, -2.19450274985)
}}}
So find_minimum_on_interval() returns a local minimum as opposed to the
global one. (The same issue applies to find_maximum_on_interval.) This
is due to the fact that the function wraps scipy.optimize.fminbound, which
is only a local optimizer (Carl Witty pointed this out). We should
instead use one of the global optimizers, i.e. scipy.optimize.anneal or
scipy.optimize.brute.
'''Apply:'''
* [attachment:trac2607.patch]
* [attachment:trac2607-whitespace.2.patch]
* [attachment:trac_2607_renaming.3.patch]
* [attachment:trac2607-doctest-and-spacing.patch]
--
Comment:
I added the commit message to whitespace patch and rebased renaming patch
based on it (keeping original authors/dates, I did not wanted to claim
their work and it was minor rebase only to accommodate the commit message
taken from comment by Dan).
I also uploaded trac2607-doctest-and-spacing.patch, which adjusts doctest
for numerical noise, fixes spacing to be more consistent (3 places, spaces
between arguments - i.e. "0,5" looks very close to "0.5" instead of "0,
5") and changed "f.find_local_minimum(" to "find_local_minimum(f" -
because after all this test occurs in definition of find_local_minimum
function, not method.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2607#comment:58>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.