$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: John Maddock (john_at_[hidden])
Date: 2008-07-16 05:28:48
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.