Skip to main content

quantile_sorted

Function quantile_sorted 

Source
pub fn quantile_sorted(sorted_data: &[f64], p: f64) -> Option<f64>
Expand description

Computes the p-th quantile on pre-sorted data (R-7 method).

This avoids the O(n log n) sort when calling multiple quantiles on the same dataset. The caller must guarantee that sorted_data is sorted in non-decreasing order.

ยงReturns

  • None if sorted_data is empty or p is outside [0, 1].