| Modifier and Type | Field and Description |
|---|---|
| private final int | numberOfSuccesses
The number of successes in the population. |
| private double | numericalVariance
Cached numerical variance |
| private boolean | numericalVarianceIsCalculated
Whether or not the numerical variance has been calculated |
| private final int | populationSize
The population size. |
| private final int | sampleSize
The sample size. |
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| public | HypergeometricDistribution(int
Population size. populationSize, int Number of successes in the population. numberOfSuccesses, int Sample size. sampleSize)Construct a new hypergeometric distribution with the specified population size, number of successes in the population, and sample size. |
| public | HypergeometricDistribution(RandomGenerator
Random number generator. rng, int Population size. populationSize, int Number of successes in the population. numberOfSuccesses, int Sample size. sampleSize)Creates a new hypergeometric distribution. |
| Modifier and Type | Method and Description |
|---|---|
| protected double | Returns: the variance of this distributionUsed by |
| public double | cumulativeProbability(int
the point at which the CDF is evaluated x)Implements org. For a random variable |
| private int[] | Returns: a two element array containing the lower and upper bounds of the hypergeometric distribution.Population size. n, int Number of successes in the population. m, int Sample size. k)Return the domain for the given hypergeometric distribution parameters. |
| private int | Returns: the lowest domain value of the hypergeometric distribution.Population size. n, int Number of successes in the population. m, int Sample size. k)Return the lowest domain value for the given hypergeometric distribution parameters. |
| public int | |
| public double | getNumericalMean()
Implements org. Use this method to get the numerical value of the mean of this distribution. |
| public double | getNumericalVariance()
Implements org. Use this method to get the numerical value of the variance of this distribution. |
| public int | |
| public int | |
| public int | Returns: lower bound of the supportImplements org. Access the lower bound of the support. |
| public int | Returns: upper bound of the supportImplements org. Access the upper bound of the support. |
| private int | Returns: the highest domain value of the hypergeometric distribution.Number of successes in the population. m, int Sample size. k)Return the highest domain value for the given hypergeometric distribution parameters. |
| private double | Returns: P(x0 <= X <= x1).Inclusive lower bound. x0, int Inclusive upper bound. x1, int Direction of summation (1 indicates summing from x0 to x1, and
0 indicates summing from x1 to x0). dx)For this distribution, |
| public boolean | Returns: trueImplements org. Use this method to get information about whether the support is connected, i.e. whether all integers between the lower and upper bound of the support are included in the support. |
| public double | logProbability(int
the point at which the PMF is evaluated x)Overrides org. For a random variable |
| public double | probability(int
the point at which the PMF is evaluated x)Implements org. For a random variable |
| public double | Returns: the upper tail CDF for this distribution.Value at which the CDF is evaluated. x)For this distribution, |
| numberOfSuccesses | back to summary |
|---|---|
| private final int numberOfSuccesses The number of successes in the population. | |
| numericalVariance | back to summary |
|---|---|
| private double numericalVariance Cached numerical variance | |
| numericalVarianceIsCalculated | back to summary |
|---|---|
| private boolean numericalVarianceIsCalculated Whether or not the numerical variance has been calculated | |
| populationSize | back to summary |
|---|---|
| private final int populationSize The population size. | |
| sampleSize | back to summary |
|---|---|
| private final int sampleSize The sample size. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serializable version identifier. | |
| HypergeometricDistribution | back to summary |
|---|---|
| public HypergeometricDistribution(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException Construct a new hypergeometric distribution with the specified population size, number of successes in the population, and sample size. Note this constructor will implicitly create an instance of
| |
| HypergeometricDistribution | back to summary |
|---|---|
| public HypergeometricDistribution(RandomGenerator rng, int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException Creates a new hypergeometric distribution.
| |
| calculateNumericalVariance | back to summary |
|---|---|
| protected double calculateNumericalVariance() Used by
| |
| cumulativeProbability | back to summary |
|---|---|
| public double cumulativeProbability(int x) Implements org. Doc from org. For a random variable
| |
| getDomain | back to summary |
|---|---|
| private int[] getDomain(int n, int m, int k) Return the domain for the given hypergeometric distribution parameters.
| |
| getLowerDomain | back to summary |
|---|---|
| private int getLowerDomain(int n, int m, int k) Return the lowest domain value for the given hypergeometric distribution parameters.
| |
| getNumberOfSuccesses | back to summary |
|---|---|
| public int getNumberOfSuccesses() Access the number of successes.
| |
| getNumericalMean | back to summary |
|---|---|
| public double getNumericalMean() Implements org. Doc from org. Use this method to get the numerical value of the mean of this
distribution.
For population size
| |
| getNumericalVariance | back to summary |
|---|---|
| public double getNumericalVariance() Implements org. Doc from org. Use this method to get the numerical value of the variance of this
distribution.
For population size
| |
| getPopulationSize | back to summary |
|---|---|
| public int getPopulationSize() Access the population size.
| |
| getSampleSize | back to summary |
|---|---|
| public int getSampleSize() Access the sample size.
| |
| getSupportLowerBound | back to summary |
|---|---|
| public int getSupportLowerBound() Implements org. Doc from org. Access the lower bound of the support. This method must return the same
value as
N, number of successes m, and sample
size n, the lower bound of the support is
max(0, n + m - N).
| |
| getSupportUpperBound | back to summary |
|---|---|
| public int getSupportUpperBound() Implements org. Doc from org. Access the upper bound of the support. This method must return the same
value as
m and sample size n, the upper
bound of the support is min(m, n).
| |
| getUpperDomain | back to summary |
|---|---|
| private int getUpperDomain(int m, int k) Return the highest domain value for the given hypergeometric distribution parameters.
| |
| innerCumulativeProbability | back to summary |
|---|---|
| private double innerCumulativeProbability(int x0, int x1, int dx) For this distribution,
| |
| isSupportConnected | back to summary |
|---|---|
| public boolean isSupportConnected() Implements org. Doc from org. Use this method to get information about whether the support is connected, i.e. whether all integers between the lower and upper bound of the support are included in the support. The support of this distribution is connected.
| |
| logProbability | back to summary |
|---|---|
| public double logProbability(int x) Overrides org. Doc from org. For a random variable
The default implementation simply computes the logarithm of
| |
| probability | back to summary |
|---|---|
| public double probability(int x) Implements org. Doc from org. For a random variable
| |
| upperCumulativeProbability | back to summary |
|---|---|
| public double upperCumulativeProbability(int x) For this distribution,
| |