bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] cdf_poisson_P


From: Georgios
Subject: Re: [Bug-gsl] cdf_poisson_P
Date: Thu, 18 Oct 2012 14:52:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

OK, that makes sense. Thanks!

Personally, however, I do not see a reason why the first argument must be unsigned int, as opposed to int. The reason why I say that is that the Poisson distribution is a distribution that gives positive probability to non negative integers and zero to the negative ones. So for negative int the 2 functions should return zero. That is just my opinion though.

Thanks again!

On 18/10/12 14:31, Rhys Ulerich wrote:
Hi Georgios,

Just to clarify: the function I am talking about is gsl_cdf_poisson_P, Not
gsl_ran_poisson_pdf that I mistakenly mentioned below. The function
gsl_ran_poisson_pdf (unsigned int k, double mu) is fine, and
gsl_ran_poisson_pdf(-1,5) returns the expected zero.
According to
http://www.gnu.org/software/gsl/manual/html_node/The-Poisson-Distribution.html
gsl_cdf_poisson_P also takes an unsigned int as the first argument.
Passing negative values to the function is impossible because the
first argument is unsigned.

That "gsl_ran_poisson_pdf(-1,5) returns the expected zero" is mere
happenstance.  Somehow feeding the function "(unsigned) -1" ==
4294967295 (according to my current system) is producing the zero.

- Rhys




reply via email to

[Prev in Thread] Current Thread [Next in Thread]