| Home | Libraries | People | FAQ | More

## Class template jeffreys_interval

boost::histogram::utility::jeffreys_interval — Jeffreys interval.

## Synopsis

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

    template<typename ValueType>
    class jeffreys_interval :
      public boost::histogram::utility::binomial_proportion_interval< ValueType >
    {
    public:

      // public member functions
      explicit jeffreys_interval(confidence_level = deviation{1}) noexcept;
      interval_type operator()(value_type, value_type) const noexcept;
    };

## Description

This is the Bayesian credible interval with a Jeffreys prior. Although it has a Bayesian derivation, it has good coverage. The interval boundaries are close to the Wilson interval. A special property of this interval is that it is equal-tailed; the probability of the true value to be above or below the interval is approximately equal.

To avoid coverage probability tending to zero when the fraction approaches 0 or 1, this implementation uses a modification described in section 4.1.2 of the paper by L.D. Brown, T.T. Cai, A. DasGupta, Statistical Science 16 (2001) 101-133, doi:10.1214/ss/1009213286.

### `jeffreys_interval` public member functions

1.     explicit jeffreys_interval(confidence_level cl = deviation{1}) noexcept;

   Construct Jeffreys 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` and`confidence_level` objects can be used to initialize the interval.

2.     interval_type
       operator()(value_type successes, value_type failures) const noexcept;

   Compute interval for given number of successes and failures.

   Parameters:

   `successes` | Number of successful trials.
   `failures` | Number of failed trials.