Dear GSL maintainers,

gsl_ran_poisson_pdf() uses a clever method to evaluate the poisson pmf
p(n) = (mu^n / n!) exp(-mu)
without evaluating the factorial directly.
To do so, it evaluates log(mu). In the special case mu = 0 this returns -nan and so gsl_ran_poisson_pdf() returns -nan.

mu = 0 corresponds to a poisson process with rate 0 and the return value of gsl_ran_poisson_pdf(k, mu) should consequently be 1.0 for k=0 and 0.0 for k>0.

This bug is similar to https://savannah.gnu.org/bugs/?func=detailitem&item_id=36328, which was accepted for octave.

Best regards,
Kai


Reply via email to