more deprecated functions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

more deprecated functions

Paul Kienzle-2

I replaced occurrences of three deprecated functions with their equivalents:
        gammai -> gammainc
        betai -> betainc
        lgamma -> gammaln

I am sending each replacement as a separate patch.

Are there any more deprecated functions you can think of?

I tested the changed functions against some matlab examples.  They work with
the following caveats.


gamma_cdf:
I was unable to reproduce a figure created with gampdf
using diff(gamma_cdf), however I was able to reproduce the equivalent
figure for chi2pdf using diff(chisquare_cdf) which depends on gamma_cdf.

I'm guessing that the definition of the gamma distribution in octave does
not match that of gamma distribution in matlab, but I haven't looked more
closely at it to see where the differences lie.

beta:
beta(0,3) fails in fortran since gamma(0) is undefined.  Matlab defines
beta(0,3) as inf, but that's wrong since the left limit is -Inf and the
right limit is +Inf.  It should return NaN.  Similarly for all other
beta wherein exactly one of a, b and a+b is a non-positive integer.
If more than one is non-negative integer, then I don't know.

Incidentally, beta(-0.5,1) returns the a value of the wrong sign.  That's
because lgamma is returning log(abs(gamma(x))) rather than log(gamma(x)).

lgamma and beta should at minimum fail gracefully for negative inputs
rather than returning an incorrect value.  If anyone really wants them
defined for negative inputs, they can fix them correctly later.

I do not have this patch ready.