Class MultinomialRVG

java.lang.Object
dev.nm.stat.random.rng.multivariate.MultinomialRVG
All Implemented Interfaces:
RandomVectorGenerator, Seedable

public class MultinomialRVG extends Object implements RandomVectorGenerator
A multinomial distribution puts N objects into K bins according to the bins' probabilities. An output random vector counts the number of objects in each bin, making a total of N.

The R equivalent function is rmultinom in package normix.

  • Constructor Details

    • MultinomialRVG

      public MultinomialRVG(int N, double[] prob, RandomLongGenerator uniform)
      Constructs a multinomial random vector generator.
      Parameters:
      N - an integer, say N, specifying the total number of objects that are put into K boxes in a typical multinomial experiment
      prob - a numeric non-negative vector of length K, specifying the probability for the K boxes
      uniform - a uniform random number generator
    • MultinomialRVG

      public MultinomialRVG(int N, double[] prob)
      Constructs a multinomial random vector generator.
      Parameters:
      N - an integer, say N, specifying the total number of objects that are put into K boxes in a typical multinomial experiment
      prob - a numeric non-negative vector of length K, specifying the probability for the K boxes
  • Method Details

    • seed

      public void seed(long... seeds)
      Description copied from interface: Seedable
      Seed the random number/vector/scenario generator to produce repeatable experiments.
      Specified by:
      seed in interface Seedable
      Parameters:
      seeds - the seeds
    • nextVector

      public double[] nextVector()
      Description copied from interface: RandomVectorGenerator
      Gets the next random vector.
      Specified by:
      nextVector in interface RandomVectorGenerator
      Returns:
      the next random vector