Bug in 3.0.1's betainc function (was Re: [OctDev] More than just an inconvenience Re: But in t_cdf: sporadic zero's when "no need")

David Bateman adb014 at gmail.com
Tue May 13 15:06:14 CDT 2008


Dave Goel wrote:
> I have looked up matlab (TM)'s answers at a friend's workstation:
> 
>>> betainc (.75, 2047, .5)
>> 4.437e-258
> 
> matlab: 4.437e-258
> 
>>> betainc (.85, 2047, .5)
>> 0
> 
> matlab: 1.0659e-146
> 
> 
>> ^^ If it returned a zero for .85, it should either do likewise for
>> .75, or it should return a better answer for .85.
>>
>>
>> ----
> 
> ((Also, for x=3, 
> 
>> betainc (3,2047,.5)
> 
> matlab rightly returns an error demanding that x be in the interval
> [0, 1]".  Octave does no such check, and returns with a convergence
> error in a numerical function.))

Then this is an issue with the underlying SLATEC function dbetai, the
only sensible way I see of fixing this is to replace it with the gsl
functions, and in that case lots of other functions in Octave should get
the same treatment.

D.



More information about the Bug-octave mailing list