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

Portabilityportable
Stabilityexperimental
Maintainerbos@serpentine.com
Safe HaskellSafe-Infered

System.Random.MWC.Distributions

Contents

Description

Pseudo-random number generation for non-uniform distributions.

Synopsis

Variates: non-uniformly distributed values

normalSource

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.

exponentialSource

Arguments

:: PrimMonad m 
=> Double

Scale parameter

-> Gen (PrimState m)

Generator

-> m Double 

Generate an exponentially distributed random variate.

gammaSource

Arguments

:: PrimMonad m 
=> Double

Shape parameter

-> Double

Scale parameter

-> Gen (PrimState m)

Generator

-> m Double 

Random variate generator for gamma distribution.

chiSquareSource

Arguments

:: PrimMonad m 
=> Int

Number of degrees of freedom

-> Gen (PrimState m)

Generator

-> m Double 

Random variate generator for the chi square distribution.

References