Class HypergeometricDistributionImpl

    • Constructor Detail

      • HypergeometricDistributionImpl

        public HypergeometricDistributionImpl​(int populationSize,
                                              int numberOfSuccesses,
                                              int sampleSize)
        Construct a new hypergeometric distribution with the given the population size, the number of successes in the population, and the sample size.
        Parameters:
        populationSize - the population size.
        numberOfSuccesses - number of successes in the population.
        sampleSize - the sample size.
    • Method Detail

      • probability

        public double probability​(int x)
        For this distribution, X, this method returns P(X = x).
        Specified by:
        probability in interface IntegerDistribution
        Parameters:
        x - the value at which the PMF is evaluated.
        Returns:
        PMF for this distribution.
      • upperCumulativeProbability

        public double upperCumulativeProbability​(int x)
        For this distribution, X, this method returns P(X ≥ x).
        Parameters:
        x - the value at which the CDF is evaluated.
        Returns:
        upper tail CDF for this distribution.
        Since:
        1.1
      • getSupportLowerBound

        public int getSupportLowerBound()
        Returns the lower bound for the support for the distribution. For population size N, number of successes m, and sample size n, the lower bound of the support is max(0, n + m - N)
        Returns:
        lower bound of the support
        Since:
        2.2
      • getSupportUpperBound

        public int getSupportUpperBound()
        Returns the upper bound for the support of the distribution. For number of successes m and sample size n, the upper bound of the support is min(m, n)
        Returns:
        upper bound of the support
        Since:
        2.2
      • getNumericalVariance

        public double getNumericalVariance()
        Returns the variance. For population size N, number of successes m, and sample size n, the variance is [ n * m * (N - n) * (N - m) ] / [ N^2 * (N - 1) ]
        Returns:
        the variance
        Since:
        2.2