java.lang.Object
dev.nm.stat.random.rng.univariate.uniform.linear.MRG
All Implemented Interfaces:
RandomLongGenerator, RandomNumberGenerator, LinearCongruentialGenerator, Seedable

public class MRG extends Object implements LinearCongruentialGenerator
A Multiple Recursive Generator (MRG) is a linear congruential generator which takes this form:

 xi = (a1 * xi-1 + a2 * xi-2 + ... + ak * xi-k) mod m
 ui = xi / m
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    MRG(long m, long... a)
    Construct a Multiple Recursive Generator.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the modulus of this linear congruential generator.
    double
    Get the next random double.
    long
    Get the next random long.
    int
    Get the order of recursion.
    void
    seed(long... x)
    Seed the random number/vector/scenario generator to produce repeatable experiments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MRG

      public MRG(long m, long... a)
      Construct a Multiple Recursive Generator.
      Parameters:
      m - the modulus
      a - multipliers for the Lehmer rng (a long)
  • Method Details