Top Description Methods
org.apache.commons.math3.stat.interval

public Interface BinomialConfidenceInterval

Known Direct Implementers
org.apache.commons.math3.stat.interval.ClopperPearsonInterval, org.apache.commons.math3.stat.interval.NormalApproximationInterval, org.apache.commons.math3.stat.interval.WilsonScoreInterval, org.apache.commons.math3.stat.interval.AgrestiCoullInterval
Imports
org.apache.commons.math3.exception.NumberIsTooLargeException, .OutOfRangeException, .NotPositiveException, .NotStrictlyPositiveException

Interface to generate confidence intervals for a binomial proportion.
Since
3.3
See Also
Binomial proportion confidence interval (Wikipedia)

Method Summary

Modifier and TypeMethod and Description
public ConfidenceInterval

Returns:

Confidence interval containing the probability of success with probability confidenceLevel
createInterval
(int
number of trials
numberOfTrials
,
int
number of successes
numberOfSuccesses
,
double
desired probability that the true probability of success falls within the returned interval
confidenceLevel
)

Create a confidence interval for the true probability of success of an unknown binomial distribution with the given observed number of trials, successes and confidence level.

Method Detail

createIntervalback to summary
public ConfidenceInterval createInterval(int numberOfTrials, int numberOfSuccesses, double confidenceLevel) throws NotStrictlyPositiveException, NotPositiveException, NumberIsTooLargeException, OutOfRangeException

Create a confidence interval for the true probability of success of an unknown binomial distribution with the given observed number of trials, successes and confidence level.

Preconditions:

  • numberOfTrials must be positive
  • numberOfSuccesses may not exceed numberOfTrials
  • confidenceLevel must be strictly between 0 and 1 (exclusive)

Parameters
numberOfTrials:int

number of trials

numberOfSuccesses:int

number of successes

confidenceLevel:double

desired probability that the true probability of success falls within the returned interval

Returns:ConfidenceInterval

Confidence interval containing the probability of success with probability confidenceLevel

Exceptions
NotStrictlyPositiveException:
if numberOfTrials <= 0.
NotPositiveException:
if numberOfSuccesses < 0.
NumberIsTooLargeException:
if numberOfSuccesses > numberOfTrials.
OutOfRangeException:
if confidenceLevel is not in the interval (0, 1).