percentileRank
Computes the percentile rank of each element, indicating what percentage of values fall at or below it.
Percentile ranks are derived from average-method ranks and scaled to the range 0 to 100 using the formula (rank - 1) / (n - 1) * 100. The smallest value receives 0 and the largest receives 100. For a single-element array, the result is 0 (the sole element is the minimum by convention).
This formula maps ranks linearly so that the minimum and maximum always land on 0 and 100 respectively, which differs from the SciPy convention 100 * (rank - 0.5) / n that would assign 50 to a single element.
Example:
doubleArrayOf(10.0, 20.0, 30.0, 40.0, 50.0).percentileRank()
// [0.0, 25.0, 50.0, 75.0, 100.0]Return
an array of percentile ranks in the range 0, 100, preserving the original element order.
Throws
if the array is empty.
if the array contains NaN.
Computes the percentile rank of each element, indicating what percentage of values fall at or below it.
This is a convenience overload that accepts any Iterable. The collection is materialized to a DoubleArray internally.
Return
a list of percentile ranks in the range 0, 100.
See also
Throws
if the collection is empty.
if the collection contains NaN.