Module: RV

Defined in:
lib/random_variates.rb

Overview

This library implements random variate generation for several common statistical distributions. Each distribution is implemented in its own class, and different parameterizations are created as instances of the class using the constructor to specify the parameterization. All constructors use named parameters for clarity, so the order of parameters does not matter. All RV classes provide an optional argument rng, with which the user can specify a U(0,1) PRNG object to use as the core source of randomness. If rng is not specified, it defaults to Kernel#rand.

Once a random variate class has been instantiated, values can either be generated on demand using the next method or by using the instance as a generator in any iterable context.

Defined Under Namespace

Modules: RV_Generator Classes: Binomial, BoxMuller, Erlang, Exponential, Gamma, Geometric, Normal, Poisson, Triangle, Uniform, VonMises, Weibull

Constant Summary collapse

U_GENERATOR =

Set default PRNG.

Xoroshiro::Random.new