public class BoundedBinomialDistribution extends BoundedDiscreteDistribution
name
Constructor and Description |
---|
BoundedBinomialDistribution(java.lang.String name,
double lowerBound,
double upperBound,
int n,
double p)
Generates the distribution for a fixed number of trials n with a success probability p.
|
BoundedBinomialDistribution(java.lang.String name,
int n,
double p)
Generates the distribution for a fixed number of trials n with a success probability p.
|
Modifier and Type | Method and Description |
---|---|
double |
drawValue()
Draws a value from the distribution randomly
through returning the value for which the cumulative distribution
of this Binomial distribution corresponds to a value drawn from a normal distribution
|
int |
getN()
Reset the numbers of independent trails used by this distribution
|
double |
getP() |
draw, getLowerBound, getUpperBound, isLowerBoundSet, isUpperBoundSet
getName, toString
public BoundedBinomialDistribution(java.lang.String name, double lowerBound, double upperBound, int n, double p) throws java.lang.IllegalArgumentException
name
- Name of the distribution to model (will be prefixed by Binomial_Distribution)lowerBound
- the lower cutoff of the distribution (distribution will not generate values smaller than this)upperBound
- the upper cutoff of the distribution (distribution will not generate values larger than this)n
- The number of tries / independent trials of Bernoulli experimentsp
- probability of success for each Bernoulli experimentjava.lang.IllegalArgumentException
- Will be thrown when parameters are illegal (n negative or p not in unit interval ([0,1]))public BoundedBinomialDistribution(java.lang.String name, int n, double p) throws java.lang.IllegalArgumentException
name
- Name of the distribution to model (will be prefixed by Binomial_Distribution)n
- The number of tries / independent trials of Bernoulli experimentsp
- probability of success for each Bernoulli experimentjava.lang.IllegalArgumentException
- Will be thrown when parameters are illegal (n negative or p not in unit interval ([0,1]))public double drawValue()
drawValue
in class BoundedDiscreteDistribution
public int getN()
n
- number of trials corresponding to this distribution replacing current numberpublic double getP()