...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

boost::accumulators::impl::pot_tail_mean_impl — Estimation of the (coherent) tail mean based on the peaks over threshold method (for both left and right tails).

template<typenameSample,typenameImpl,typenameLeftRight>structpot_tail_mean_impl {// typestypedefnumeric::functional::average< Sample, std::size_t >::result_type float_type;typedeffloat_type result_type;// construct/copy/destructpot_tail_mean_impl(dont_care);// public member functionstemplate<typenameArgs> result_type result(Argsconst&)const; };

Computes an estimate for the (coherent) tail mean

where , and are the parameters of the generalized Pareto distribution that approximates the right tail of the distribution (or the mirrored left tail, in case the left tail is used). In the latter case, the result is mirrored back, yielding the correct result.