Statistics
Class Random

java.lang.Object
  extended byStatistics.Random

public class Random
extends java.lang.Object

Provides static methods to generate random numbers based on the * cern.jet.random random number generators.

* *

Two uniform random number generators (MersenneTwisters with different * seeds) are allocated to support the Box Muller standard normal random number * generator with "more independent" uniform coordinates v1, v2. * This shows slight improvement versus repeated calls to the same uniform * random number gnerator.

* *

The two uniform random number generators are seeded statically and so * cycle through the same sequences of random numbers when restarted. * The same is true of the standard normal random numbers derived from these. *

* * @author Michael J. Meyer


Field Summary
static cern.jet.random.Uniform uniform_1
          First MersenneTwister uniform random number generator.
static cern.jet.random.Uniform uniform_2
          Second MersenneTwister uniform random number generator.
 
Constructor Summary
Random()
           
 
Method Summary
static int Sign()
          Fair draw from {1,-1}.
static int Sign(double p)
          Loaded draw X from {-1,1}.
static double STN()
          Standard normal deviate using the inverse normal CDF on uniform * deviates generated by the Mersenne Twister.
static double U1()
          First uniform u\in(0,1).
static double U2()
          Second uniform u\in(0,1).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uniform_1

public static final cern.jet.random.Uniform uniform_1

First MersenneTwister uniform random number generator.


uniform_2

public static final cern.jet.random.Uniform uniform_2

Second MersenneTwister uniform random number generator.

Constructor Detail

Random

public Random()
Method Detail

U1

public static double U1()

First uniform u\in(0,1).


U2

public static double U2()

Second uniform u\in(0,1).


Sign

public static int Sign()
Fair draw from {1,-1}.


Sign

public static int Sign(double p)

Loaded draw X from {-1,1}. * X=1 with probability p, * X=-1 with probability 1-p.

* * @param p Probability that X=+1.


STN

public static double STN()

Standard normal deviate using the inverse normal CDF on uniform * deviates generated by the Mersenne Twister.