Boost C++ Libraries

...one 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.
PrevUpHomeNext

Class template clopper_pearson_interval

boost::histogram::utility::clopper_pearson_interval — Clopper-Pearson interval.

Synopsis

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

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

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

Description

This is the classic frequentist interval obtained with the Neyman construction. It is therefore often called the 'exact' interval. It is guaranteed to have at least the requested confidence level for all values of the fraction.

The interval is wider than others that produce coverage closer to the expected confidence level over a random ensemble of factions. The Clopper-Pearson interval essentially always overcovers for such a random ensemble, which is undesirable in practice. The Clopper-Pearson interval is recommended when it is important to be conservative, but the Wilson interval should be preferred in most applications.

C. Clopper, E.S. Pearson (1934), Biometrika 26 (4): 404-413. doi:10.1093/biomet/26.4.404.

clopper_pearson_interval public construct/copy/destruct

  1. explicit clopper_pearson_interval(confidence_level cl = deviation{1}) noexcept;
    Construct Clopper-Pearson interval computer.

    Parameters:

    cl

    Confidence level for the interval. The default value produces a confidence level of 68 % equivalent to one standard deviation. Both deviation andconfidence_level objects can be used to initialize the interval.

clopper_pearson_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.

    Parameters:

    failures

    Number of failed trials.

    successes

    Number of successful trials.


PrevUpHomeNext