Defined in header <scicpp/core.hpp>
Compute the p-th percentile.
Interpolation method to use when the desired percentile lies between two data points i < j:
enum class QuantileInterp : int {
LOWER, // i
HIGHER, // j
NEAREST, // i or j, whichever is nearest.
MIDPOINT, // (i + j) / 2.
LINEAR // i + (j - i) * fraction, where fraction is the fractional part of the index surrounded by i and j.
};
interpolation
= QuantileInterp::LINEAR, class InputIt
, class Predicate
, typename T
>percentile
(InputIt first, InputIt last, T q, Predicate filter)¶Compute the p
-th percentile of data defined by a pair of iterators first
, last
satisfying the predicate filter
.
interpolation
= QuantileInterp::LINEAR, class Array
, class Predicate
, typename T
>percentile
(const Array &f, T q, Predicate filter)¶Compute the p
-th percentile of data in the array f
satisfying the predicate filter
.
interpolation
= QuantileInterp::LINEAR, class Array
, typename T
>percentile
(Array &&f, T q)¶Compute the p
-th percentile of data in the array f
.
interpolation
= QuantileInterp::LINEAR, class Array
, typename T
>nanpercentile
(const Array &f, T q)¶Compute the p
-th percentile of data in the array f
excluding NaN’s.