org.apache.commons.math3.stat.interval

## Class WilsonScoreInterval

- java.lang.Object
- - org.apache.commons.math3.stat.interval.WilsonScoreInterval

- All Implemented Interfaces:
    BinomialConfidenceInterval

      public class WilsonScoreInterval
      extends Object
      implements BinomialConfidenceInterval

  Implements the Wilson score method for creating a binomial proportion confidence interval.
  Since:
    3.3
  Version:
    $Id: WilsonScoreInterval.java 1560928 2014-01-24 09:58:43Z luc $
  See Also:
    Wilson score interval (Wikipedia)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WilsonScoreInterval()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WilsonScoreInterval

          public WilsonScoreInterval()

  - ### Method Detail

    - #### 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 positive
      - `numberOfSuccesses` may not exceed `numberOfTrials`
      - `confidenceLevel` must be strictly between 0 and 1 (exclusive)
      Specified by:
        `createInterval` in interface `BinomialConfidenceInterval`
      Parameters:
        `numberOfTrials` - number of trials
        `numberOfSuccesses` - number of successes
        `confidenceLevel` - desired probability that the true probability of success falls within the returned interval
      Returns:
        Confidence interval containing the probability of success with probability `confidenceLevel`

Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.