Extends the class DiscreteDistributionInt for the hypergeometric distribution [64] (page 101) with \(k\) elements chosen among \(l\), \(m\) being of one type, and \(l-m\) of the other. More...
Public Member Functions | |
| HypergeometricDist (int m, int l, int k) | |
| Constructs an hypergeometric distribution with parameters \(m\),. | |
| double | prob (int x) |
| Returns \(p(x)\), the probability of \(x\). | |
| double | cdf (int x) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). | |
| double | barF (int x) |
| Returns \(\bar{F}(x)\), the complementary distribution function. | |
| int | inverseFInt (double u) |
| Returns the inverse distribution function \(F^{-1}(u)\), where. | |
| double | getMean () |
| Returns the mean of the distribution function. | |
| double | getVariance () |
| Returns the variance of the distribution function. | |
| double | getStandardDeviation () |
| Returns the standard deviation of the distribution function. | |
| int | getM () |
| Returns the \(m\) associated with this object. | |
| int | getL () |
| Returns the \(l\) associated with this object. | |
| int | getK () |
| Returns the \(k\) associated with this object. | |
| double[] | getParams () |
| Return a table containing the parameters of the current distribution. | |
| void | setParams (int m, int l, int k) |
| Resets the parameters of this object to \(m\), \(l\) and \(k\). | |
| String | toString () |
| Returns a String containing information about the current distribution. | |
| Public Member Functions inherited from umontreal.ssj.probdist.DiscreteDistributionInt | |
| double | cdf (double x) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). | |
| double | barF (double x) |
| Returns \(\bar{F}(x)\), the complementary distribution function. | |
| int | getXinf () |
| Returns the lower limit \(x_a\) of the support of the probability mass function. | |
| int | getXsup () |
| Returns the upper limit \(x_b\) of the support of the probability mass function. | |
| double | inverseF (double u) |
| Returns the inverse distribution function \(F^{-1}(u)\), where. | |
Static Public Member Functions | |
| static double | prob (int m, int l, int k, int x) |
Computes the hypergeometric probability \(p(x)\) given by ( fheperg ). | |
| static double | cdf (int m, int l, int k, int x) |
| Computes the distribution function \(F(x)\). | |
| static double | barF (int m, int l, int k, int x) |
| Computes the complementary distribution function. | |
| static int | inverseF (int m, int l, int k, double u) |
| Computes \(F^{-1}(u)\) for the hypergeometric distribution without using precomputed tables. | |
| static double | getMean (int m, int l, int k) |
| Computes and returns the mean \(E[X] = km/l\) of the Hypergeometric distribution with parameters \(m\), \(l\) and. | |
| static double | getVariance (int m, int l, int k) |
| Computes and returns the variance. | |
| static double | getStandardDeviation (int m, int l, int k) |
| Computes and returns the standard deviation of the hypergeometric distribution with parameters \(m\), \(l\) and \(k\). | |
Static Public Attributes | |
Constant @{ | |
| static double | MAXN = 100000 |
| If the number of integers in the interval \([\max(0,k-l+m), \min(k,m)]\) is larger than this constant, the tables will not be precomputed by the constructor. | |
| Static Public Attributes inherited from umontreal.ssj.probdist.DiscreteDistributionInt | |
| static double | EPSILON = 1.0e-16 |
| Environment variable that determines what probability terms can be considered as negligible when building precomputed tables for distribution and mass functions. | |
Extends the class DiscreteDistributionInt for the hypergeometric distribution [64] (page 101) with \(k\) elements chosen among \(l\), \(m\) being of one type, and \(l-m\) of the other.
The parameters \(m\), \(k\) and \(l\) are positive integers where
\(1\le m\le l\) and \(1\le k\le l\). Its mass function is given by
\[ p(x) = \frac{ \binom{m}{x} \binom{l - m}{k-x}}{\binom{l}{k}} \qquad\mbox{for } \max(0,k-l+m)\le x\le\min(k, m). \tag{fheperg} \]
Definition at line 43 of file HypergeometricDist.java.
| umontreal.ssj.probdist.HypergeometricDist.HypergeometricDist | ( | int | m, |
| int | l, | ||
| int | k ) |
Constructs an hypergeometric distribution with parameters \(m\),.
\(l\) and \(k\).
Definition at line 70 of file HypergeometricDist.java.
|
static |
Computes the complementary distribution function.
WARNING: The complementary distribution function is defined as \(\bar{F}(x) = P[X \ge x]\).
Definition at line 210 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.barF | ( | int | x | ) |
Returns \(\bar{F}(x)\), the complementary distribution function.
See the WARNING above. The default implementation returns 1.0 - cdf(x - 1), which is not accurate when \(F(x)\) is near 1.
| x | value at which the complementary distribution function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 101 of file HypergeometricDist.java.
|
static |
Computes the distribution function \(F(x)\).
Definition at line 183 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.cdf | ( | int | x | ) |
Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
| x | value at which the distribution function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 82 of file HypergeometricDist.java.
| int umontreal.ssj.probdist.HypergeometricDist.getK | ( | ) |
Returns the \(k\) associated with this object.
Definition at line 331 of file HypergeometricDist.java.
| int umontreal.ssj.probdist.HypergeometricDist.getL | ( | ) |
Returns the \(l\) associated with this object.
Definition at line 324 of file HypergeometricDist.java.
| int umontreal.ssj.probdist.HypergeometricDist.getM | ( | ) |
Returns the \(m\) associated with this object.
Definition at line 317 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.getMean | ( | ) |
Returns the mean of the distribution function.
Implements umontreal.ssj.probdist.Distribution.
Definition at line 140 of file HypergeometricDist.java.
|
static |
Computes and returns the mean \(E[X] = km/l\) of the Hypergeometric distribution with parameters \(m\), \(l\) and.
\(k\).
Definition at line 272 of file HypergeometricDist.java.
| double[] umontreal.ssj.probdist.HypergeometricDist.getParams | ( | ) |
Return a table containing the parameters of the current distribution.
This table is put in regular order: [ \(m\), \(l\), \(k\)].
Implements umontreal.ssj.probdist.Distribution.
Definition at line 401 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.getStandardDeviation | ( | ) |
Returns the standard deviation of the distribution function.
Implements umontreal.ssj.probdist.Distribution.
Definition at line 148 of file HypergeometricDist.java.
|
static |
Computes and returns the standard deviation of the hypergeometric distribution with parameters \(m\), \(l\) and \(k\).
Definition at line 310 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.getVariance | ( | ) |
Returns the variance of the distribution function.
Implements umontreal.ssj.probdist.Distribution.
Definition at line 144 of file HypergeometricDist.java.
|
static |
Computes and returns the variance.
\(\mbox{Var}[X] = \frac{(km/l)(1 - m/l)(l - k)}{l - 1}\) of the hypergeometric distribution with parameters \(m\), \(l\) and \(k\).
Definition at line 292 of file HypergeometricDist.java.
|
static |
Computes \(F^{-1}(u)\) for the hypergeometric distribution without using precomputed tables.
The inversion is computed using the chop-down algorithm [98] .
Definition at line 237 of file HypergeometricDist.java.
| int umontreal.ssj.probdist.HypergeometricDist.inverseFInt | ( | double | u | ) |
Returns the inverse distribution function \(F^{-1}(u)\), where.
\(0\le u\le1\). The default implementation uses binary search.
| u | value in the interval \((0,1)\) for which the inverse distribution function is evaluated |
| IllegalArgumentException | if \(u\) is not in the interval \((0,1)\) |
| ArithmeticException | if the inverse cannot be computed, for example if it would give infinity in a theoritical context |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 120 of file HypergeometricDist.java.
|
static |
Computes the hypergeometric probability \(p(x)\) given by ( fheperg ).
Definition at line 156 of file HypergeometricDist.java.
| double umontreal.ssj.probdist.HypergeometricDist.prob | ( | int | x | ) |
Returns \(p(x)\), the probability of \(x\).
| x | value at which the mass function must be evaluated |
Reimplemented from umontreal.ssj.probdist.DiscreteDistributionInt.
Definition at line 74 of file HypergeometricDist.java.
| void umontreal.ssj.probdist.HypergeometricDist.setParams | ( | int | m, |
| int | l, | ||
| int | k ) |
Resets the parameters of this object to \(m\), \(l\) and \(k\).
Definition at line 409 of file HypergeometricDist.java.
| String umontreal.ssj.probdist.HypergeometricDist.toString | ( | ) |
Returns a String containing information about the current distribution.
Definition at line 430 of file HypergeometricDist.java.
|
static |
If the number of integers in the interval \([\max(0,k-l+m), \min(k,m)]\) is larger than this constant, the tables will not be precomputed by the constructor.
Definition at line 59 of file HypergeometricDist.java.