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

Copyright(c) 2012 Bryan O'Sullivan
LicenseBSD3
Maintainerbos@serpentine.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

System.Random.MWC.Distributions

Contents

Description

Pseudo-random number generation for non-uniform distributions.

Synopsis

Variates: non-uniformly distributed values

normal

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 Double

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.

exponential

Arguments

:: PrimMonad m 
=> Double

Scale parameter

-> Gen (PrimState m)

Generator

-> m Double 

Generate an exponentially distributed random variate.

gamma

Arguments

:: PrimMonad m 
=> Double

Shape parameter

-> Double

Scale parameter

-> Gen (PrimState m)

Generator

-> m Double 

Random variate generator for gamma distribution.

chiSquare

Arguments

:: PrimMonad m 
=> Int

Number of degrees of freedom

-> Gen (PrimState m)

Generator

-> m Double 

Random variate generator for the chi square distribution.

References