[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: betainc accuracy
From: |
Rik |
Subject: |
Re: betainc accuracy |
Date: |
Sat, 06 Jul 2013 10:50:09 -0700 |
On 07/06/2013 08:55 AM, address@hidden wrote:
> Message: 4
> Date: Sat, 6 Jul 2013 17:22:56 +0200
> From: "Dr. Alexander Klein" <address@hidden>
> To: Octave Maintainers <address@hidden>
> Subject: binocdf accuracy
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear list,
>
> the other day I was writing up some statistical functions in Erlang, and kept
> cross-checking the results with what Octave produced.
>
> One of my experiments included binocdf (0:50,50,1-1e-3 )', and while I admit
> that the example is somewhat extreme, I suspect that almost all values
> returned by Octave are inaccurate, while binopdf (0:50,50,1-1e-3 )' produces
> results nearly identical to my implementation in Erlang, see attachments.
>
> I think this would be easy to patch if only binocdf was afflicted, but
> binocdf uses the incomplete beta function, and so maybe other functions might
> have problems, too.
>
> Since I'll need the incomplete beta function for my Erlang-library anyway, I
> might as well try to come up with an improved version for Octave, but I'd
> like to be sure that at least my reference values for binocdf are accurate.
>
> Is anyone on the list perhaps able to check my results against a reliable
> implementation of binocdf?
7/6/13
Dr. Klein,
Octave's implementation of the incomplete beta function is written in
Fortran and comes from the directory slatec-fn.
The C++ code which calls it is in liboctave/numeric/lo-specfun.cc at line 2243.
double
betainc (double x, double a, double b)
{
double retval;
F77_XFCN (xdbetai, XDBETAI, (x, a, b, retval));
return retval;
}
The Fortran code is in liboctave/cruft/slatec-fn/betai.f.
It might be worth verifying that betainc alone produces the values that you
expect before moving on to testing binocdf.
--Rik
- Re: betainc accuracy,
Rik <=