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. |
real*8 pmc_rand::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.
mean | Mean of distribution. |
stddev | Standard deviation of distribution. |
integer pmc_rand::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 mean 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:
mean | Mean of the distribution. |