[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave-1.0.11 Comments and Queries
From: |
Jim Van Zandt |
Subject: |
Re: octave-1.0.11 Comments and Queries |
Date: |
Mon, 06 Apr 1998 08:43:37 -0400 |
John -
Thanks! This must be why my calculations of the chi-square function
have been wrong with recent releases of Octave. (I have downgraded to
2.0.5, until Dirk Eddelbuettel <address@hidden>, the Debian
maintainer, can incorporate your patch.)
- Jim Van Zandt
> | B: It seems gammai(a,x) is the wrong way round, in that it gives the
> | result you would expect if x were the exponent and a were the
> | integration limit. It turns out, looking at the m-file which calls
> | gammainc as gammainc(x,a), and testing gammainc, that it is gammainc
> | which is the wrong way round (i.e. gammainc(x,a) gives the result
> | you would expect if x were the exponent and a the limit).
> |
> | Is this a bug or is it intentional? (I've changed the gammai m-file
> | which is easy, but it might be worth re-compiling the gammainc .oct
> | file since that's where the trouble really is).
>
> This is a bug. Here's my fix:
>
> *** liboctave/lo-specfun.cc~ Thu Feb 19 01:28:15 1998
> --- liboctave/lo-specfun.cc Mon Apr 6 00:27:28 1998
> ***************
> *** 477,483 ****
> gammainc (double x, double a)
> {
> double retval;
> ! F77_XFCN (xdgami, XDGAMI, (x, a, retval));
> return retval;
> }
>
> --- 477,483 ----
> gammainc (double x, double a)
> {
> double retval;
> ! F77_XFCN (xdgami, XDGAMI, (a, x, retval));
> return retval;
> }
>
> *** libcruft/slatec-fn/xdgami.f~ Sun Nov 30 18:22:24 1997
> --- libcruft/slatec-fn/xdgami.f Mon Apr 6 00:26:16 1998
> ***************
> *** 1,5 ****
> ! subroutine xdgami (x, a, result)
> ! double precision x, a, result, dgami
> ! result = dgami (x, a)
> return
> end
> --- 1,5 ----
> ! subroutine xdgami (a, x, result)
> ! double precision a, x, result, dgami
> ! result = dgami (a, x)
> return
> end
>
> However, the order of the arguments in the gammai and gammainc
> functions is correct. gammainc is compatible with Matlab, gammai is
> compatible with older versions of Octave.