Rnd module is for generating random variables of various distributions.
Please refer to GSL documentation for details.
val flat : float ‑> float ‑> float
flat a b
draws a random number from the interval [a,b)
with a uniform
distribution.
val uniform : unit ‑> float
uniform
returns a random float number within [0,1)
, including 0
but excluding 1. uniform ()
is equivalent to flat 0. 1.
val gaussian : ?sigma:float ‑> unit ‑> float
gaussian ~sigma:s ()
returns the value of a random variable that
follows Normal distribution of sigma = s
.
val gaussian_tail : float ‑> float ‑> float
gaussian_tail a x sigma
returns a random value of a gaussian tail
distribution. note "a" must be positive.
val bivariate_gaussian : float ‑> float ‑> float ‑> float * float
bivariate_gaussian sigma_x sigma_y rho
returns a pair of correlated
gaussian variates, with mean zero, correlation coefficient rho -1, 1
and
standard deviations sigma_x and sigma_y in the x and y directions.
val exponential : float ‑> float
exponential mu
return a random value that follows exponential distribution.