16 Jul
2008
16 Jul
'08
9:28 a.m.
Michael Fuller wrote:
I've searched the Boost documentation and mail archive, but I can't find an example for extracting a random variate from a Poisson distribution. What I want to do is similar to extracting a variate from a uniform distribution, such as the C++ rand() function, which returns a single random variate on the range [0, RAND_MAX].
Is there a way to do something similar using the Poisson distribution with a given mean? For example, something like this:
double n, lambda(0.30); //lambda is the mean of the Poisson n = poisson_rand(lambda);
Try boost/random/poisson_distribution.hpp, unfortunately appears not to be documented, but usage is the same as the other distributions in Boost.Random. HTH, John.