[SciPy-User] expanding optimize.brentq
Mon Mar 18 14:09:32 CDT 2013
On Mon, Mar 18, 2013 at 2:58 PM, Charles R Harris <firstname.lastname@example.org
> On Mon, Mar 18, 2013 at 11:13 AM, <email@example.com> wrote:
>> Just a thought, given the problems with fsolve
>> In scipy.stats.distribution, we use an expanding brentq, which looks
>> like it works very well.
>> A question given that I have not much experience with root finders:
>> Is there a general algorithm that has similar properties?
>> In these application we know that the function is strictly monotonic,
>> but we don't have a bound for brentq without checking. For some cases
>> I know one of the bounds (e.g. 0 for non-negative solutions).
>> (I could use that right now as a replacement for fsolve.)
> Your application looks to be finding points on a monotone function on the
> interval [0, inf]. For that you could use the interval [0, 1] and map it to
> [0, inf] with the substitution x/1-x, although the point x == 1 will be a
> bit tricky unless your function handles inf gracefully. The accuracy will
> also tend to be relative rather than absolute, but that seems to be a given
> in any case. I suppose this approach falls under the change of variables
Ah, right. Yes, I think this will work well for our current use case (if I
understand the scope of the problem sufficiently). At least it seems to do
the trick with the sticking points I was seeing. It also improves the
perfomance without the bounding interval methods - fsolve, etc.
> Those tend to be problem specific, so I don't know if they would be a good
> fit for scipy, but certainly they could work well in specialized domains.
> It would also seem to be a good idea to match the asymptotic behavior if
> possible, which will tend to linearize the problem. So other options would
> be functions like log, erf, arctan, etc, for the substitution, but in those
> cases you probably already have the the inverse functions.
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User