|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.distribution.AbstractDiscreteDistribution
org.apache.commons.math.distribution.BinomialDistributionImpl
The default implementation of BinomialDistribution
.
Constructor Summary | |
BinomialDistributionImpl(int trials,
double p)
Create a binomial distribution with the given number of trials and probability of success. |
Method Summary | |
double |
cummulativeProbability(int x)
For this disbution, X, this method returns P(X ≤ x). |
protected int |
getDomainLowerBound(double p)
Access the domain value lower bound, based on p , used to
bracket a PDF root. |
protected int |
getDomainUpperBound(double p)
Access the domain value upper bound, based on p , used to
bracket a PDF root. |
int |
getNumberOfTrials()
Access the number of trials for this distribution. |
double |
getProbabilityOfSuccess()
Access the probability of success for this distribution. |
double |
probability(int x)
For this disbution, X, this method returns P(X = x). |
void |
setNumberOfTrials(int trials)
Change the number of trials for this distribution. |
void |
setProbabilityOfSuccess(double p)
Change the probability of success for this distribution. |
Methods inherited from class org.apache.commons.math.distribution.AbstractDiscreteDistribution |
cummulativeProbability, inverseCummulativeProbability |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.distribution.DiscreteDistribution |
cummulativeProbability, inverseCummulativeProbability |
Constructor Detail |
public BinomialDistributionImpl(int trials, double p)
trials
- the number of trials.p
- the probability of success.Method Detail |
public int getNumberOfTrials()
getNumberOfTrials
in interface BinomialDistribution
public double getProbabilityOfSuccess()
getProbabilityOfSuccess
in interface BinomialDistribution
public void setNumberOfTrials(int trials)
setNumberOfTrials
in interface BinomialDistribution
trials
- the new number of trials.public void setProbabilityOfSuccess(double p)
setProbabilityOfSuccess
in interface BinomialDistribution
p
- the new probability of success.protected int getDomainLowerBound(double p)
p
, used to
bracket a PDF root.
getDomainLowerBound
in class AbstractDiscreteDistribution
p
- the desired probability for the critical value
p
protected int getDomainUpperBound(double p)
p
, used to
bracket a PDF root.
getDomainUpperBound
in class AbstractDiscreteDistribution
p
- the desired probability for the critical value
p
public double cummulativeProbability(int x) throws MathException
cummulativeProbability
in interface DiscreteDistribution
x
- the value at which the PDF is evaluated.
MathException
public double probability(int x)
probability
in interface DiscreteDistribution
x
- the value at which the PMF is evaluated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |