Defined in header <scicpp/core.hpp>
Compute the q-th quantile.
Interpolation method to use when the desired quantile 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
>quantile
(InputIt first, InputIt last, T q, Predicate filter)¶Compute the q
-th quantile of data defined by a pair of iterators first
, last
satisfying the predicate filter
.
interpolation
= QuantileInterp::LINEAR, class Array
, class Predicate
, typename T
>quantile
(const Array &f, T q, Predicate filter)¶Compute the q
-th quantile of data in the array f
satisfying the predicate filter
.
interpolation
= QuantileInterp::LINEAR, class Array
, typename T
>quantile
(Array &&f, T q)¶Compute the q
-th quantile of data in the array f
.
interpolation
= QuantileInterp::LINEAR, class Array
, typename T
>nanquantile
(const Array &f, T q)¶Compute the q
-th quantile of data in the array f
excluding NaN’s.