boostorg / accumulators

An awesome library from Boost
http://boost.org/libs/accumulators
22 stars 54 forks source link

[DO NOT MERGE] Feature request: use all tracked probabilities to estimate a quantile #60

Closed adimajo closed 5 months ago

adimajo commented 5 months ago

In [weighted_][extended_]p_square.hpp, the p-square algorithm (an online - in the sense that it doesn't require storing all samples - quantile estimator) is implemented. Additionally:

The extended version also introduces the ability to use interpolation:

In essence:

To show this, the MWE2.{cpp,py} programs are provided.

Note that estimates of quantiles 0.35 and 0.65 are reasonable (in some sense, they lie in the "linear regime" of the quantile function), but estimates of quantiles 0.1 and 0.9 are poor. Quantiles 0.0005 and 0.9995 could not be computed by the current implementation due its limitations (see above), returning nan.

MWE2

Notes:

adimajo commented 5 months ago

Closing because the same result can be achieved by compiling with -fno-access-control, see issue #61.