|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.probdist.DiscreteDistributionInt
umontreal.iro.lecuyer.probdist.NegativeBinomialDist
public class NegativeBinomialDist
Extends the class DiscreteDistributionInt for
the negative binomial distribution with
parameters n and p, where n is a positive
integer and
0 <= p <= 1.
Its mass function is
BinomialDist.
This p(x) can be interpreted as the probability of having x failures
before the nth success in a sequence of independent Bernoulli trials
with probability of success p.
For n = 1, this gives the geometric distribution.
| Field Summary | |
|---|---|
static double |
MAXN
|
| Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt |
|---|
EPSILON |
| Constructor Summary | |
|---|---|
NegativeBinomialDist(int n,
double p)
Creates an object that contains the probability terms and the distribution function for the negative binomial distribution with parameter n and p. |
|
| Method Summary | |
|---|---|
double |
barF(int x)
Returns bar(F)(x), the complementary distribution function. |
double |
cdf(int x)
Returns the distribution function F evaluated at x (see). |
static double |
cdf(int n,
double p,
int x)
Computes the distribution function. |
int |
getN()
Returns the parameter n of this object. |
double |
getP()
Returns the parameter p of this object. |
int |
inverseF(double u)
Returns the inverse distribution function F-1(u), where 0 <= u <= 1. |
static int |
inverseF(int n,
double p,
double u)
Computes the inverse function without precomputing tables. |
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 n,
double p,
int x)
Computes the probability mass function. |
void |
setParams(int n,
double p)
Sets the parameter n and p of this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static double MAXN
| Constructor Detail |
|---|
public NegativeBinomialDist(int n,
double p)
| Method Detail |
|---|
public double prob(int x)
DiscreteDistributionInt
prob in class DiscreteDistributionIntx - value at which the mass function must be evaluated
public double cdf(int x)
DiscreteDistributionInt
cdf in class DiscreteDistributionIntx - value at which the distribution function must be evaluated
public double barF(int x)
DiscreteDistributionInt
barF in class DiscreteDistributionIntx - value at which the complementary distribution function
must be evaluated
public int inverseF(double u)
DiscreteDistributionInt
inverseF in class DiscreteDistributionIntu - value in the interval (0, 1) for which
the inverse distribution function is evaluated
public static double prob(int n,
double p,
int x)
public static double cdf(int n,
double p,
int x)
public static int inverseF(int n,
double p,
double u)
public int getN()
public double getP()
public void setParams(int n,
double p)
|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||