public class NegativeBinomialDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED| Constructor and Description |
|---|
NegativeBinomialDistribution()
This default constructor creates a new negative binomial distribution with
successes parameter 1 and probability parameter 0.5.
|
NegativeBinomialDistribution(int k,
double p)
This general constructor creates a new negative binomial distribution with
given parameter values.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDensity(double x)
This method computes the probability density function.
|
double |
getMaxDensity()
This method computes the maximum value of the density function.
|
double |
getMean()
This method computes the mean of the distribution.
|
double |
getMGF(double t)
This method computes moment generating function.
|
double |
getPGF(double t)
This method computes the probability generating function.
|
double |
getProbability()
This method returns the probability parameter.
|
int |
getSuccesses()
This method returns the successes parameter.
|
double |
getVariance()
This method computes the variance of the distribution.
|
void |
setParameters(int k,
double p)
This method set the paramters and the default domain.
|
void |
setProbability(double p)
This method sets the probability parameter.
|
void |
setSuccesses(int k)
This method set the successes parameter.
|
double |
simulate()
This method simulates a value from the distribution, overriding the
correspondin default method in Distribution.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getCDF, getDomain, getFailureRate, getMedian, getMoment, getMoment, getQuantile, getSD, getType, setDomain, setDomainpublic NegativeBinomialDistribution(int k,
double p)
k - the number of successesp - the probability of successpublic NegativeBinomialDistribution()
public void setParameters(int k,
double p)
k - the number of successesp - the probability of successpublic void setSuccesses(int k)
k - the number of successespublic int getSuccesses()
public double getProbability()
public void setProbability(double p)
p - the probability of successpublic double getDensity(double x)
getDensity in class Distributionx - a number in the domain of the distributionpublic double getMaxDensity()
getMaxDensity in class Distributionpublic double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic double getPGF(double t)
getPGF in class Distributiont - a real numberpublic double getMGF(double t)
getMGF in class Distributiont - a real numberpublic double simulate()
simulate in class Distributionpublic java.lang.String toString()
toString in class Distribution