Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class template wilson_interval

boost::histogram::utility::wilson_interval — Wilson interval.


// In header: <boost/histogram/fwd.hpp>

template<typename ValueType> 
class wilson_interval :
  public boost::histogram::utility::binomial_proportion_interval< ValueType >
  // construct/copy/destruct
  explicit wilson_interval(deviation = deviation{1.0}) noexcept;

  // public member functions
  interval_type operator()(value_type, value_type) const noexcept;


The Wilson score interval is simple to compute, has good coverage. Intervals are automatically bounded between 0 and 1 and never empty. The interval is asymmetric.

Wilson, E. B. (1927). "Probable inference, the law of succession, and statistical inference". Journal of the American Statistical Association. 22 (158): 209-212. doi:10.1080/01621459.1927.10502953. JSTOR 2276774.

The coverage probability for a random ensemble of fractions is close to the nominal value. Unlike the Clopper-Pearson interval, the Wilson score interval is not conservative. For some values of the fractions, the interval undercovers and overcovers for neighboring values. This is a shared property of all alternatives to the Clopper-Pearson interval.

The Wilson score intervals is widely recommended for general use in the literature. For a review of the literature, see R. D. Cousins, K. E. Hymes, J. Tucker, Nucl. Instrum. Meth. A 612 (2010) 388-398.

wilson_interval public construct/copy/destruct

  1. explicit wilson_interval(deviation d = deviation{1.0}) noexcept;
    Construct Wilson interval computer.



    Number of standard deviations for the interval. The default value 1 corresponds to a confidence level of 68 %. Both deviation andconfidence_level objects can be used to initialize the interval.

wilson_interval public member functions

  1. interval_type 
    operator()(value_type successes, value_type failures) const noexcept;
    Compute interval for given number of successes and failures.



    Number of failed trials.


    Number of successful trials.