pmc_rand Namespace Reference

Random number generators. 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

Random number generators.

Function Documentation

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.

Parameters:
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:

Parameters:
mean  Mean of the distribution.


Generated on Mon Apr 26 17:13:31 2010 for PartMC by  doxygen 1.5.6