...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::tail_quantile_impl — Tail quantile estimation based on order statistics (for both left and right tails)

// In header: <boost/accumulators/statistics/tail_quantile.hpp> template<typename Sample, typename LeftRight> struct tail_quantile_impl { // types typedef Sample result_type; // construct/copy/destruct tail_quantile_impl(dont_care); // public member functions template<typename Args> result_type result(Args const &) const; };

The estimation of a tail quantile with level based on order statistics requires the chaching of at least the smallest or the largest samples, being the total number of samples. The largest of the smallest samples or the smallest of the largest samples provides an estimate for the quantile: