Random2

scalation.random.Random2
case class Random2(stream: Int) extends RNG

The Random2 class generates random real numbers in the range (0, 1). It implements, using 32-bit integers (Int's), the 'MRG31k3p' generator developed by L'Ecuyer and Touzin, described in "FAST COMBINED MULTIPLE RECURSIVE GENERATORS WITH MULTIPLIERS OF THE FORM a = 2^q +/- 2^r". MRG31k3p is a Combined Multiple Recursive Generator (CMRG) shown to have good performance and statistical properties for simulations. It has a period of about 2^185 and is considered to be a faster alternative to the popular 'MRG32k3' generator. MRG31k3p combines MRG1 and MRG2.

MRG1: x_i = (0          + a_12 x_i-2 + a_13 x_i-3) % M1
MRG2: x_i = (a_21 x_i-1 + 0          + a_23 x_i-3) % M2

where a_12 = 2^22, a_13 = 2^7+1, a_21 = 2^15 and a_23 = 2^15+1.

Value parameters

stream

the random number stream index

Attributes

See also
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RNG
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

inline def gen: Double

Return the next random number as a real Double in the interval (0, 1). This calculation uses 32-bit integers Int.

Return the next random number as a real Double in the interval (0, 1). This calculation uses 32-bit integers Int.

Attributes

inline def igen: Int

Return the next stream value as an integer. This calculation uses 32-bit integers Int.

Return the next stream value as an integer. This calculation uses 32-bit integers Int.

Attributes

Inherited methods

def pf(z: Double): Double

Compute the probability function (pf), i.e., the probability density function (pdf).

Compute the probability function (pf), i.e., the probability density function (pdf).

Value parameters

z

the mass point whose probability density is sought

Attributes

Inherited from:
RNG
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Inherited fields

val mean: Double

Return the theoretical mean for the random number generator's 'gen' method.

Return the theoretical mean for the random number generator's 'gen' method.

Attributes

Inherited from:
RNG