Interface BinomialConfidenceInterval
- All Known Implementing Classes:
AgrestiCoullInterval,ClopperPearsonInterval,NormalApproximationInterval,WilsonScoreInterval
public interface BinomialConfidenceInterval
Interface to generate confidence intervals for a binomial proportion.
- Since:
- 3.3
- See Also:
-
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.
-
Method Details
-
createInterval
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:
numberOfTrialsmust be positivenumberOfSuccessesmay not exceednumberOfTrialsconfidenceLevelmust be strictly between 0 and 1 (exclusive)
- 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 - Throws:
NotStrictlyPositiveException- ifnumberOfTrials <= 0.NotPositiveException- ifnumberOfSuccesses < 0.NumberIsTooLargeException- ifnumberOfSuccesses > numberOfTrials.OutOfRangeException- ifconfidenceLevelis not in the interval(0, 1).
-