public class NegativeBinomialDistribution extends COLTDiscreteDistribution
generator
name
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, toString
public 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()
UnivariateDistribution
draw
in class UnivariateDistribution
public void setN(int n)
public void setP(double p)
public int getN()
public double getP()