Documentation of 'umontreal.iro.lecuyer.randvar.HypergeometricGen' Java class
HypergeometricGen
umontreal.iro.lecuyer.randvar

Class HypergeometricGen



  • public class HypergeometricGen
    extends RandomVariateGenInt
    This class implements random variate generators for the hypergeometric distribution. Its mass function is

    p(x) = nCr(m, x)nCr(l - m, k - x)/nCr(l, k)        for x = max(0, k - l + m),..., min(k, m)

    where nCr(n, x) is the number of possible combinations when choosing x elements among a set of n elements, m, l and k are integers that satisfy 0 < m <= l and 0 < k <= l.

    The generation method is inversion using the chop-down algorithm

    • Constructor Detail

      • HypergeometricGen

        public HypergeometricGen(RandomStream s,
                                 int m,
                                 int l,
                                 int k)
        Creates a hypergeometric generator with parameters m = m, l = l and k = k, using stream s.
      • HypergeometricGen

        public HypergeometricGen(RandomStream s,
                                 HypergeometricDist dist)
        Creates a new generator for distribution dist, using stream s.
    • Method Detail

      • nextInt

        public static int nextInt(RandomStream s,
                                  int m,
                                  int l,
                                  int k)
        Generates a new variate from the hypergeometric distribution with parameters m = m, l = l and k = k, using stream s.
      • getM

        public int getM()
        Returns the m associated with this object.
      • getL

        public int getL()
        Returns the l associated with this object.
      • getK

        public int getK()
        Returns the k associated with this object.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.