| java.lang.Object org.apache.commons.math.distribution.AbstractDistribution org.apache.commons.math.distribution.AbstractIntegerDistribution org.apache.commons.math.distribution.BinomialDistributionImpl
Constructor Summary | |
public | BinomialDistributionImpl(int trials, double p) Create a binomial distribution with the given number of trials and
probability of success. |
Method Summary | |
public double | cumulativeProbability(int x) For this distribution, X, this method returns P(X ≤ x).
Parameters: x - the value at which the PDF is evaluated. | 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. | public int | getNumberOfTrials() Access the number of trials for this distribution. | public double | getProbabilityOfSuccess() Access the probability of success for this distribution. | public int | inverseCumulativeProbability(double p) For this distribution, X, this method returns the largest x, such
that P(X ≤ x) ≤ p . | public double | probability(int x) For this disbution, X, this method returns P(X = x).
Parameters: x - the value at which the PMF is evaluated. | public void | setNumberOfTrials(int trials) Change the number of trials for this distribution. | public void | setProbabilityOfSuccess(double p) Change the probability of success for this distribution. |
BinomialDistributionImpl | public BinomialDistributionImpl(int trials, double p)(Code) | | Create a binomial distribution with the given number of trials and
probability of success.
Parameters: trials - the number of trials. Parameters: p - the probability of success. |
cumulativeProbability | public double cumulativeProbability(int x) throws MathException(Code) | | For this distribution, X, this method returns P(X ≤ x).
Parameters: x - the value at which the PDF is evaluated. PDF for this distribution. throws: MathException - if the cumulative probability can not becomputed due to convergence or other numerical errors. |
getDomainLowerBound | protected int getDomainLowerBound(double p)(Code) | | Access the domain value lower bound, based on p , used to
bracket a PDF root.
Parameters: p - the desired probability for the critical value domain value lower bound, i.e.P(X < lower bound) < p |
getDomainUpperBound | protected int getDomainUpperBound(double p)(Code) | | Access the domain value upper bound, based on p , used to
bracket a PDF root.
Parameters: p - the desired probability for the critical value domain value upper bound, i.e.P(X < upper bound) > p |
getNumberOfTrials | public int getNumberOfTrials()(Code) | | Access the number of trials for this distribution.
the number of trials. |
getProbabilityOfSuccess | public double getProbabilityOfSuccess()(Code) | | Access the probability of success for this distribution.
the probability of success. |
inverseCumulativeProbability | public int inverseCumulativeProbability(double p) throws MathException(Code) | | For this distribution, X, this method returns the largest x, such
that P(X ≤ x) ≤ p .
Returns -1 for p=0 and Integer.MAX_VALUE for
p=1.
Parameters: p - the desired probability the largest x such that P(X ≤ x) <= p throws: MathException - if the inverse cumulative probability can not becomputed due to convergence or other numerical errors. throws: IllegalArgumentException - if p < 0 or p > 1 |
probability | public double probability(int x)(Code) | | For this disbution, X, this method returns P(X = x).
Parameters: x - the value at which the PMF is evaluated. PMF for this distribution. |
setNumberOfTrials | public void setNumberOfTrials(int trials)(Code) | | Change the number of trials for this distribution.
Parameters: trials - the new number of trials. throws: IllegalArgumentException - if trials is not a validnumber of trials. |
setProbabilityOfSuccess | public void setProbabilityOfSuccess(double p)(Code) | | Change the probability of success for this distribution.
Parameters: p - the new probability of success. throws: IllegalArgumentException - if p is not a validprobability. |
Methods inherited from org.apache.commons.math.distribution.AbstractDistribution | public double cumulativeProbability(double x0, double x1) throws MathException(Code)(Java Doc)
|
|
|