public class HypergeometricDist extends DiscreteDistributionInt
DiscreteDistributionInt for
the hypergeometric distribution 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 <= m <= l and
1 <= k <= l.
Its mass function is given by
BinomialDist.| Modifier and Type | Field and Description |
|---|---|
static double |
MAXN |
EPSILON| Constructor and Description |
|---|
HypergeometricDist(int m,
int l,
int k)
Constructs an hypergeometric distribution with parameters
m, l and k.
|
| Modifier and Type | Method and Description |
|---|---|
double |
barF(int x)
Returns bar(F)(x), the complementary
distribution function.
|
static double |
barF(int m,
int l,
int k,
int x)
Computes the complementary distribution function.
|
double |
cdf(int x)
Returns the distribution function F evaluated at x
(see).
|
static double |
cdf(int m,
int l,
int k,
int x)
Computes the distribution function F(x).
|
int |
getK()
Returns the k associated with this object.
|
int |
getL()
Returns the l associated with this object.
|
int |
getM()
Returns the m associated with this object.
|
double |
getMean()
Returns the mean of the distribution function.
|
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 k.
|
double[] |
getParams()
Return a table containing the parameters of the current distribution.
|
double |
getStandardDeviation()
Returns the standard deviation of the distribution function.
|
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.
|
double |
getVariance()
Returns the variance of the distribution function.
|
static double |
getVariance(int m,
int l,
int k)
Computes and returns the variance
of the hypergeometric distribution with parameters m, l and k.
|
static int |
inverseF(int m,
int l,
int k,
double u)
Computes F-1(u) for the hypergeometric distribution without
using precomputed tables.
|
int |
inverseFInt(double u)
Returns the inverse distribution function
F-1(u), where
0 <= u <= 1.
|
double |
prob(int x)
Returns p(x), the probability of x,
which should be a real number in the interval [0, 1].
|
static double |
prob(int m,
int l,
int k,
int x)
Computes the hypergeometric probability
p(x).
|
void |
setParams(int m,
int l,
int k)
Resets the parameters of this object to m, l and k.
|
java.lang.String |
toString() |
public HypergeometricDist(int m,
int l,
int k)
public double prob(int x)
DiscreteDistributionIntprob in class DiscreteDistributionIntx - value at which the mass function must be evaluatedpublic double cdf(int x)
DiscreteDistributionIntcdf in class DiscreteDistributionIntx - value at which the distribution function must be evaluatedpublic double barF(int x)
DiscreteDistributionIntbarF in class DiscreteDistributionIntx - value at which the complementary distribution function
must be evaluatedpublic int inverseFInt(double u)
DiscreteDistributionIntinverseFInt in class DiscreteDistributionIntu - value in the interval (0, 1) for which
the inverse distribution function is evaluatedpublic double getMean()
Distributionpublic double getVariance()
Distributionpublic double getStandardDeviation()
Distributionpublic static double prob(int m,
int l,
int k,
int x)
public static double cdf(int m,
int l,
int k,
int x)
public static double barF(int m,
int l,
int k,
int x)
public static int inverseF(int m,
int l,
int k,
double u)
public static double getMean(int m,
int l,
int k)
public static double getVariance(int m,
int l,
int k)
public static double getStandardDeviation(int m,
int l,
int k)
public int getM()
public int getL()
public int getK()
public double[] getParams()
public void setParams(int m,
int l,
int k)
public java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.