QuantileMethod
Selects the algorithm used to compute quantiles and percentiles from sample data.
There are nine standard estimation methods defined by Hyndman and Fan (1996), numbered HF1 through HF9. Each method uses a different formula to map a probability to a position in the sorted data, and they differ in how they handle positions that fall between data points. Methods HF1 through HF3 are discontinuous (they return actual data points), while HF4 through HF9 use linear interpolation between neighboring values.
In addition, four rounding-based methods (LOWER, HIGHER, NEAREST, MIDPOINT) use the same position formula as LINEAR (HF7) but apply different rounding instead of linear interpolation. These are useful when you need to select an actual data point rather than an interpolated value.
The default method is LINEAR (HF7), which is the default in R, S, NumPy, and Pandas.
Example:
val data = doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0)
data.quantile(0.25, QuantileMethod.LINEAR) // 2.0 (default, HF7)
data.quantile(0.25, QuantileMethod.MEDIAN_UNBIASED) // 1.75 (HF8)
data.quantile(0.25, QuantileMethod.WEIBULL) // 1.5 (HF6)See also
Entries
Inverse of the empirical cumulative distribution function (HF1, R type 1).
Averaged inverse of the empirical CDF (HF2, R type 2).
Nearest observation with ties to even, as used by SAS (HF3, R type 3).
Linear interpolation of the empirical CDF (HF4, R type 4).
Approximately median-unbiased quantile estimator (HF8, R type 8).
Approximately normal-unbiased quantile estimator (HF9, R type 9).
Properties
Functions
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.