package prbnmcn-stats
Module Stats.GenSource
Generative distributions.
Implementation of generative distributions parameterized by stateful RNG implementation.
Instantiation of the Make functor with Random.State.
include Stats_intf.Gen with type state = Random.State.t
Follows the module type of a sampling-based monad
include Basic_structures.Basic_intf.Monad
with type 'a t = (state, 'a) Stats_intf.gen
and type 'a res = (state, 'a) Stats_intf.gen
'a t is the type of computations of type 'a
'a res is the outcome of running a computation of type 'a
shuffle a samples a uniform permutation of a. Uses Fisher-Yates shuffle algorithm.
uniform elts samples an element of the elts array by sampling an index uniformly.
geometric p samples a nonnegative integer according to the geometric law of parameter p.
of_empirical emp samples from emp matching exactly the empirical frequencies.
Gaussian distribution via Box-Muller transform. Returns a pair of independent gaussian variates with prescribed mean and standard deviation.
Gaussian distribution (wrapper over box-muller transform).
Poisson distribution via inverse transform. Consider using other methods for large lambda.
Samples uniformly in the given range.
Samples uniformly in the n-dimensional axis-aligned box defined by min and max.
Categorical distribution. Total mass need not be one. Does not aggregate mass of equal elements.
without_replacement n l samples a subset of size n from l without replacement.
tup2 g1 g2 samples the component of a tuple independently from g1 and g2.
See tup2
mixture weights gens samples from the convex combination of weights. weights need to be normalized, non-negative floats.