Class ClopperPearsonInterval
java.lang.Object
org.apache.commons.math3.stat.interval.ClopperPearsonInterval
- All Implemented Interfaces:
BinomialConfidenceInterval
Implements the Clopper-Pearson method for creating a binomial proportion confidence interval.
- Since:
- 3.3
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInterval
(int numberOfTrials, int numberOfSuccesses, double 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.
-
Constructor Details
-
ClopperPearsonInterval
public ClopperPearsonInterval()
-
-
Method Details
-
createInterval
public ConfidenceInterval createInterval(int numberOfTrials, int numberOfSuccesses, double 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.Preconditions:
numberOfTrials
must be positivenumberOfSuccesses
may not exceednumberOfTrials
confidenceLevel
must be strictly between 0 and 1 (exclusive)
- Specified by:
createInterval
in interfaceBinomialConfidenceInterval
- Parameters:
numberOfTrials
- number of trialsnumberOfSuccesses
- number of successesconfidenceLevel
- desired probability that the true probability of success falls within the returned interval- Returns:
- Confidence interval containing the probability of success with
probability
confidenceLevel
-