|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.probdist.DiscreteDistributionInt umontreal.iro.lecuyer.probdist.NegativeBinomialDist
public class NegativeBinomialDist
Extends the class DiscreteDistributionInt
for
the negative binomial distribution with real
parameters n and p, where n > 0 and
0 <= p <= 1.
Its mass function is
If n is an integer, p(x) can be interpreted as the probability
of having x failures before the n-th success in a sequence of
independent Bernoulli trials with probability of success p. This special
case is implemented as the Pascal distribution (see PascalDist
).
Field Summary | |
---|---|
static double |
MAXN
|
Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt |
---|
EPSILON |
Constructor Summary | |
---|---|
NegativeBinomialDist(double n,
double p)
Creates an object that contains the probability terms and the distribution function for the negative binomial distribution with parameters n and p. |
Method Summary | |
---|---|
static double |
barF(double n,
double p,
int x)
Returns bar(F)(x) = P[X >= x], the complementary distribution function. |
double |
barF(int x)
Returns bar(F)(x), the complementary distribution function. |
static double |
cdf(double n,
double p,
int x)
Computes the distribution function. |
double |
cdf(int x)
Returns the distribution function F evaluated at x (see). |
double |
getGamma()
Deprecated. |
static NegativeBinomialDist |
getInstanceFromMLE(int[] x,
int m)
Creates a new instance of a negative binomial distribution with parameters n and p estimated using the maximum likelihood method based on the m observations x[i], i = 0, 1,…, m - 1. |
static NegativeBinomialDist |
getInstanceFromMLE(int[] x,
int m,
double n)
Creates a new instance of a negative binomial distribution with parameters n given and hat(p) estimated using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
static NegativeBinomialDist |
getInstanceFromMLE1(int[] x,
int m,
double p)
Creates a new instance of a negative binomial distribution with parameters p given and hat(n) estimated using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
double |
getMean()
Returns the mean of the distribution function. |
static double |
getMean(double n,
double p)
Computes and returns the mean E[X] = n(1 - p)/p of the negative binomial distribution with parameters n and p. |
static double[] |
getMLE(int[] x,
int m)
Estimates the parameter (n, p) of the negative binomial distribution using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
static double[] |
getMLE(int[] x,
int m,
double n)
Estimates the parameter p of the negative binomial distribution using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
static double[] |
getMLE1(int[] x,
int m,
double p)
Estimates the parameter n of the negative binomial distribution using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
static double |
getMLEninv(int[] x,
int m)
Estimates and returns the parameter ν = 1/hat(n) of the negative binomial distribution using the maximum likelihood method, from the m observations x[i], i = 0, 1,…, m - 1. |
double |
getN()
Returns the parameter n of this object. |
double |
getP()
Returns the parameter p of this object. |
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(double n,
double p)
Computes and returns the standard deviation of the negative binomial distribution with parameters n and p. |
double |
getVariance()
Returns the variance of the distribution function. |
static double |
getVariance(double n,
double p)
Computes and returns the variance Var[X] = n(1 - p)/p2 of the negative binomial distribution with parameters n and p. |
static int |
inverseF(double n,
double p,
double u)
Computes the inverse function without precomputing tables. |
int |
inverseFInt(double u)
Returns the inverse distribution function F-1(u), where 0 <= u <= 1. |
static double |
prob(double n,
double p,
int x)
Computes the probability p(x). |
double |
prob(int x)
Returns p(x), the probability of x. |
void |
setParams(double n,
double p)
Sets the parameter n and p of this object. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt |
---|
barF, cdf, getXinf, getXsup, inverseF |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double MAXN
Constructor Detail |
---|
public NegativeBinomialDist(double n, double p)
Method Detail |
---|
public double prob(int x)
DiscreteDistributionInt
prob
in class DiscreteDistributionInt
x
- value at which the mass function must be evaluated
public double cdf(int x)
DiscreteDistributionInt
cdf
in class DiscreteDistributionInt
x
- value at which the distribution function must be evaluated
public double barF(int x)
DiscreteDistributionInt
barF
in class DiscreteDistributionInt
x
- value at which the complementary distribution function
must be evaluated
public int inverseFInt(double u)
DiscreteDistributionInt
inverseFInt
in class DiscreteDistributionInt
u
- value in the interval (0, 1) for which
the inverse distribution function is evaluated
public double getMean()
Distribution
public double getVariance()
Distribution
public double getStandardDeviation()
Distribution
public static double prob(double n, double p, int x)
public static double cdf(double n, double p, int x)
public static double barF(double n, double p, int x)
public static int inverseF(double n, double p, double u)
public static double[] getMLE(int[] x, int m, double n)
x
- the list of observations used to evaluate parametersm
- the number of observations used to evaluate parametersn
- the first parameter of the negative binomial
public static NegativeBinomialDist getInstanceFromMLE(int[] x, int m, double n)
x
- the list of observations to use to evaluate parametersm
- the number of observations to use to evaluate parametersn
- the first parameter of the negative binomialpublic static double[] getMLE1(int[] x, int m, double p)
x
- the list of observations used to evaluate parametersm
- the number of observations used to evaluate parametersp
- the second parameter of the negative binomial
public static NegativeBinomialDist getInstanceFromMLE1(int[] x, int m, double p)
x
- the list of observations to use to evaluate parametersm
- the number of observations to use to evaluate parametersp
- the second parameter of the negative binomialpublic static double[] getMLE(int[] x, int m)
x
- the list of observations used to evaluate parametersm
- the number of observations used to evaluate parameters
public static NegativeBinomialDist getInstanceFromMLE(int[] x, int m)
x
- the list of observations to use to evaluate parametersm
- the number of observations used to evaluate parameterspublic static double getMLEninv(int[] x, int m)
x
- the list of observations used to evaluate parameterm
- the number of observations used to evaluate parameter
public static double getMean(double n, double p)
public static double getVariance(double n, double p)
public static double getStandardDeviation(double n, double p)
@Deprecated public double getGamma()
public double getN()
public double getP()
public void setParams(double n, double p)
public double[] getParams()
public String toString()
toString
in class Object
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |