public class NegativeBinomialDistribution extends COLTDiscreteDistribution
generatorname| Constructor and Description |
|---|
NegativeBinomialDistribution(java.lang.String name,
int n,
double p)
Creates a negative binomial distribution wrapping the corresponding COLT distribution.
|
| Modifier and Type | Method and Description |
|---|---|
double |
draw()
Draw a value from the distribution according to the distribution at hand
|
int |
getN() |
double |
getP() |
void |
setN(int n) |
void |
setP(double p) |
getName, toStringpublic NegativeBinomialDistribution(java.lang.String name,
int n,
double p)
throws java.lang.IllegalArgumentException
name - Name of the distribution (will be prefixed with NegativeBinomialDistribution_)n - number trials modeledp - success probability of each trialjava.lang.IllegalArgumentException - will be thrown when one of the parameter is out of range (n < 1 or p not in unit interval)public double draw()
UnivariateDistributiondraw in class UnivariateDistributionpublic void setN(int n)
public void setP(double p)
public int getN()
public double getP()