|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uah.math.distributions.Distribution
edu.uah.math.distributions.NegativeBinomialDistribution
public class NegativeBinomialDistribution
This class models the negative binomial distribution with specified successes parameter and probability parameter.
| Field Summary |
|---|
| Fields inherited from class edu.uah.math.distributions.Distribution |
|---|
CONTINUOUS, DISCRETE, MIXED |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class edu.uah.math.distributions.Distribution |
|---|
getCDF, getDomain, getFailureRate, getMedian, getMoment, getMoment, getQuantile, getSD, getType, setDomain, setDomain |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NegativeBinomialDistribution(int k,
double p)
k - the number of successesp - the probability of successpublic NegativeBinomialDistribution()
| Method Detail |
|---|
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 distribution
public 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 number
public double getMGF(double t)
getMGF in class Distributiont - a real number
public double simulate()
simulate in class Distributionpublic java.lang.String toString()
toString in class Distribution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||