public class Binomial extends DiscreteDistribution
The Binomial distribution.
References:
| Constructor and Description |
|---|
Binomial()
Default constructor.
|
Binomial(int n,
double p)
Create a distribution with the given number of trials and probability of
success.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cumulativeProbability(int x)
The CDF for this distribution.
|
int |
getNumberOfTrials()
Access the number of trials.
|
double |
getProbabilityOfSuccess()
Access probability of success.
|
int |
inverseCumulativeProbability(double p)
The inverse CDF for this distribution.
|
double |
probability(int x)
The PMF for this distribution.
|
void |
setNumberOfTrials(int n)
Modify the number of trials.
|
void |
setProbabilityOfSuccess(double p)
Modify probability of success.
|
public Binomial()
public Binomial(int n,
double p)
n - the number of trials.p - the probability of success.public double cumulativeProbability(int x)
throws NumericException
cumulativeProbability in class DiscreteDistributionx - the value at which the CDF is evaluated.NumericException - if the cumulative probability can not be
computed.public int getNumberOfTrials()
public double getProbabilityOfSuccess()
public int inverseCumulativeProbability(double p)
throws NumericException
inverseCumulativeProbability in class DiscreteDistributionp - the cumulative probability.NumericException - if the inverse cumulative probability can not be
computed.public double probability(int x)
probability in class DiscreteDistributionx - the value at which the probability is evaluated.public void setNumberOfTrials(int n)
n - the new number of trials value.public void setProbabilityOfSuccess(double p)
p - the new probability of success value.DMelt 2.0 © DataMelt by jWork.ORG