Skip Menu |

This queue is for tickets about the PDL-Stats CPAN distribution.

Report information
The Basics
Id: 107326
Status: open
Priority: 0/
Queue: PDL-Stats

People
Owner: Nobody in particular
Requestors: jafa82 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in PDL::GSL::CDF
Date: Fri, 25 Sep 2015 08:50:49 -0400
To: bug-PDL-Stats [...] rt.cpan.org
From: Eric Damien <jafa82 [...] gmail.com>
Dear maintainer(s), I would like to point what I consider a mistake to you: $ gsl_cdf_hypergeometric_P(0,2,8,6) # just a reference 0.133333333333333 $ gsl_cdf_hypergeometric_P(-1,2,8,6) # the error 1 $ gsl_cdf_hypergeometric_P(18,2,8,6) # another reference 1 As one can see gsl_cdf_hypergeometric_P reports a CDF value of 1 for a negative value (when 0 is expected). I did not investigate all the other functions (i.e. CDFs), but having been reviewing a program I am writing down to this brick, I think it may be useful to ensure about the rest. Nonetheless, thank you for a great piece of work, Eric Damien. P.S: PDL::Stats $VERSION = '0.72' ; Perl 5.20 .
Thanks for reporting this. It should give an error when provided with a negative value, given that the original c function has a signature of double gsl_cdf_hypergeometric_P (unsigned int k, unsigned int n1, unsigned int n2, unsigned int t) I'll look into why it doesn't fail with an error. On 2015-09-25 08:50:59, jafa82@gmail.com wrote: Show quoted text
> Dear maintainer(s), > > > I would like to point what I consider a mistake to you: > > $ gsl_cdf_hypergeometric_P(0,2,8,6) # just a reference > 0.133333333333333 > > $ gsl_cdf_hypergeometric_P(-1,2,8,6) # the error > 1 > > $ gsl_cdf_hypergeometric_P(18,2,8,6) # another reference > > 1 > > > As one can see gsl_cdf_hypergeometric_P reports a CDF value of 1 for a > negative value (when 0 is expected). > > I did not investigate all the other functions (i.e. CDFs), but having been > reviewing a program I am writing down to this brick, I think it may be > useful > to ensure about the rest. > > > Nonetheless, thank you for a great piece of work, > > Eric Damien. > > > P.S: > PDL::Stats $VERSION = '0.72' ; > Perl 5.20 .
I have PR-ed a test that demonstrates this. As I say on PR, I don't currently know how to tell PDL to reject negative inputs here.