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")

View: New views
6 Messages — Rating Filter:   Alert me  

Parent Message unknown 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")

by Dave Goel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



>> [ tcdf bug reported]
>>
>>  
>
> This is an octave core function and so issues should be reported to
> bug@.... That being said you should upgrade from 2.1.73 as that
> is a very old version of Octave. The latest stable release is 3.0.1.
> Also the t_cdf function had its name changed to tcdf in newer versions
> of Octave (though t_cdf is still around) for compatibility with the
> Matlab Statistics Toolbox function. Finally, I think we have to check
> the behavior against the equivalent function in Matlab for the case you
> believe is in error, but I don't have access to matlab with the
> statistics toolbox and so can't do it myself.
>

Sorry about the version.  I have now installed octave 3.0.1 (on
        windoze)
as a test system and replicated the bug there.  CC-ing to octave-dev
as an ack. of David's message.

 (I don't have matlab, but a bug is a bug.  I understand that when one
 uses discrete lookup tables, some "errors" will always creep in, but
 we should do our best to resolve them.)

The error comes from the underlying betainc function.  That is an oct
file, so I couldn't further trace the source of the error.

Betainc function should be, an increasing function of x, but here's
the problem -

> betainc (.75, 2047, .5)

4.437e-258

> betainc (.85, 2047, .5)

0

^^ If it returned a zero for .85, it should either do likewise for
.75, or it should return a better answer for .85.


----






_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

Re: 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")

by Dave Goel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.))

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

Re: 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")

by David Bateman-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

Re: 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")

by John W. Eaton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 13-May-2008, David Bateman wrote:

| 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.

I think this should be a goal for 3.2.

jwe
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

Re: 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")

by dbateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


John W. Eaton wrote:
On 13-May-2008, David Bateman wrote:

| 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.

I think this should be a goal for 3.2.

jwe
By 3.2 do you mean in the current unstable release 3.1 that will become the next stable release or after the next stable release?

D.


Re: 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")

by John W. Eaton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 19-May-2008, dbateman wrote:

| By 3.2 do you mean in the current unstable release 3.1 that will become the
| next stable release or after the next stable release?

Not the next stable release, but the one after, unless someone
convinces me that it should have a much higher priority.

jwe
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave