pmc_rand_poisson Namespace Reference

Poisson random number generator. More...

Functions

integer rand_poisson (mean)
 Generate a Poisson-distributed random number with the given mean.
real *8 rand_normal (mean, stddev)
 Generates a normally distributed random number with the given mean and standard deviation.

Detailed Description

Poisson random number generator.


Function Documentation

real*8 pmc_rand_poisson::rand_normal ( real*8,intent(in)  mean,
real*8,intent(in)  stddev 
)

Generates a normally distributed random number with the given mean and standard deviation.

Parameters:
mean Mean of distribution.
stddev Standard deviation of distribution.
integer pmc_rand_poisson::rand_poisson ( real*8,intent(in)  mean  ) 

Generate a Poisson-distributed random number with the given mean.

See http://en.wikipedia.org/wiki/Poisson_distribution for information on the method. The method used at present is rather inefficient and inaccurate (brute force for below 10 and normal approximation above that point).

The best known method appears to be due to Ahrens and Dieter (ACM Trans. Math. Software, 8(2), 163-179, 1982) and is available (in various forms) from:

Unfortunately the above code is under the non-free license:

Parameters:
mean Mean of the distribution.

Generated on 29 Mar 2010 for PartMC by  doxygen 1.6.1