[Scipy-tickets] [SciPy] #737: gammaln valid range is incorrect
SciPy
scipy-tickets@scipy....
Sat Nov 1 12:01:05 CDT 2008
#737: gammaln valid range is incorrect
--------------------+-------------------------------------------------------
Reporter: cdavid | Owner: cdavid
Type: defect | Status: new
Priority: high | Milestone: 0.7.0
Component: Other | Version:
Severity: normal | Resolution:
Keywords: |
--------------------+-------------------------------------------------------
Comment (by G-J):
The info line for gammaln reads:
* gammaln -- Log of the absolute value of the gamma function.
With this definition of gammaln, the function actually works fine,
since np.log(abs(gamma(-0.5))) is in fact 1.2655. However, this seems
to be an unusual definition for gammaln. What is the best way to fix
it? Options:
1) Keep it as it is, with gammaln(x) = ln|gamma(x)|
2) Change it so that it returns NaN for negative values of gamma(x)
(i.e. negative x whose floor value is odd)
3) Change it to always give NaN for negative values of x (Matlab's
approach)
4) Have it return complex values for negative logarithms
Which is best?
--
Ticket URL: <http://scipy.org/scipy/scipy/ticket/737#comment:4>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list