[SciPy-User] expanding optimize.brentq
Skipper Seabold
jsseabold@gmail....
Mon Mar 18 14:09:32 CDT 2013
On Mon, Mar 18, 2013 at 2:58 PM, Charles R Harris <charlesr.harris@gmail.com
> wrote:
>
>
> On Mon, Mar 18, 2013 at 11:13 AM, <josef.pktd@gmail.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.
>> https://github.com/scipy/scipy/pull/216/files#L0R1175
>>
>> 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.)
>>
>
<snip>
> 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
> method.
>
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.
Thanks, Chuck.
Skipper
> 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.
>
> Chuck
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20130318/716fdd65/attachment.html
More information about the SciPy-User
mailing list