public class NegativeBinomial extends DiscreteDistribution
The Negative Binomial distribution.
References:
Constructor and Description |
---|
NegativeBinomial()
Default constructor.
|
NegativeBinomial(int r,
double p)
Create a distribution with the given number of successes and probability
of success.
|
Modifier and Type | Method and Description |
---|---|
double |
cumulativeProbability(int x)
The CDF for this distribution.
|
double |
getMean()
Get mean value.
|
int |
getNumberOfSuccesses()
Access the number of successes.
|
double |
getProbabilityOfSuccess()
Access probability of success.
|
double |
getVariance()
Get mean value.
|
int |
inverseCumulativeProbability(double p)
The inverse CDF for this distribution.
|
double |
probability(int x)
The PMF for this distribution.
|
void |
setNumberOfSuccesses(int r)
Modify the number of successes.
|
void |
setProbabilityOfSuccess(double p)
Modify probability of success.
|
public NegativeBinomial()
public NegativeBinomial(int r, double p)
r
- the number of successes.p
- the probability of success.public double cumulativeProbability(int x) throws NumericException
cumulativeProbability
in class DiscreteDistribution
x
- the value at which the CDF is evaluated.NumericException
- if the cumulative probability can not be
computed.public int getNumberOfSuccesses()
public double getProbabilityOfSuccess()
public int inverseCumulativeProbability(double p) throws NumericException
inverseCumulativeProbability
in class DiscreteDistribution
p
- the cumulative probability.NumericException
- if the inverse cumulative probability can not be
computed.public double probability(int x)
probability
in class DiscreteDistribution
x
- the value at which the probability is evaluated.public void setNumberOfSuccesses(int r)
r
- the new number of successes value.public double getMean()
r
- the new number of successes value.public double getVariance()
r
- the new number of successes value.public void setProbabilityOfSuccess(double p)
p
- the new probability of success value.Jas4pp 1.5 © Java Analysis Studio for Particle Physics