mwc-random-0.13.0.0: Fast, high quality pseudo random number generation

Portability portable experimental bos@serpentine.com None

System.Random.MWC.Distributions

Description

Pseudo-random number generation for non-uniform distributions.

Synopsis

# Variates: non-uniformly distributed values

Arguments

 :: PrimMonad m => Double Mean -> Double Standard deviation -> Gen (PrimState m) -> m Double

Generate a normally distributed random variate with given mean and standard deviation.

standard :: PrimMonad m => Gen (PrimState m) -> m DoubleSource

Generate a normally distributed random variate with zero mean and unit variance.

The implementation uses Doornik's modified ziggurat algorithm. Compared to the ziggurat algorithm usually used, this is slower, but generates more independent variates that pass stringent tests of randomness.

Arguments

 :: PrimMonad m => Double Scale parameter -> Gen (PrimState m) Generator -> m Double

Generate an exponentially distributed random variate.

Arguments

 :: PrimMonad m => Double Scale parameter -> (Double, Double) Range to which distribution is truncated. Values may be negative. -> Gen (PrimState m) Generator. -> m Double

Generate truncated exponentially distributed random variate.

Arguments

 :: PrimMonad m => Double Shape parameter -> Double Scale parameter -> Gen (PrimState m) Generator -> m Double

Random variate generator for gamma distribution.

Arguments

 :: PrimMonad m => Int Number of degrees of freedom -> Gen (PrimState m) Generator -> m Double

Random variate generator for the chi square distribution.

Arguments

 :: PrimMonad m => Double p success probability lies in (0,1] -> Gen (PrimState m) Generator -> m Int

Random variate generator for the geometric distribution, computing the number of failures before success. Supports [0..].

Arguments

 :: PrimMonad m => Double p success probability lies in (0,1] -> Gen (PrimState m) Generator -> m Int

Random variate generator for geometric distribution for number of trials. Supports [1..] (i.e. just `geometric0` shifted by 1).