[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gsl_ran_negative_binomial_pdf
From: |
Redekopp, Eric |
Subject: |
gsl_ran_negative_binomial_pdf |
Date: |
Mon, 18 Sep 2023 17:21:09 +0000 |
gsl_ran_negative_binomial_pdf gives -NaN if p == 1.0, despite p=1 being a valid
negative binomial distribution. I believe this is because of the call to
log1p(-p) which evaluates to log(0) and gives NaN. There appear to be guards
against this in the positive version (gsl_ran_binomial_pdf) and it works as
expected, however these edge cases aren't covered in the negative version. I
think that the negative version should have similar guards to return
appropriate values for edge cases like p==1.
Thanks for your consideration,
Eric Redekopp
University of Saskatchewan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gsl_ran_negative_binomial_pdf,
Redekopp, Eric <=