case class Random(stream: Int = 0) extends RNG with Product with Serializable
The Random
class generates random real numbers in the range (0, 1).
It implements, using 64-bit integers (Long's), the 'MRG31k3p' generator
developed by L'Ecuyer and Touzin, described in "FAST COMBINED MULTIPLE
RECURSIVE GENERATORS WITH MULTIPLIERS OF THE FORM a = 2q +/- 2r".
MRG31k3p is a Combined Multiple Recursive Generator (CMRG) shown to have good
performance and statistical properties for simulations. It has a period of
about 2185 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 = 222, a_13 = 27+1, a_21 = 215 and a_23 = 2^15+1.
- stream
the random number stream index
- See also
http://www.informs-sim.org/wsc00papers/090.PDF
http://www.iro.umontreal.ca/~simardr/ssj/doc/pdf/guiderng.pdf
- Alphabetic
- By Inheritance
- Random
- Serializable
- Product
- Equals
- RNG
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Random(stream: Int = 0)
- stream
the random number stream index
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def flaw(method: String, message: String): Unit
- Definition Classes
- Error
- def gen: Double
Return the next random number as a real (Double) in the interval (0, 1).
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def igen: Int
Return the next stream value as an integer 'Int'.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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.
- Definition Classes
- RNG
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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).
- z
the mass point whose probability density is sought
- Definition Classes
- RNG
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val stream: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated