Skip to main content

order_statistic_from_sorted

Function order_statistic_from_sorted 

Source
pub fn order_statistic_from_sorted(sorted: &[f64], rank: usize) -> f64
Expand description

Exact 1-based order statistic from an already sorted slice.

Returns NaN when the slice is empty, rank is zero, or rank exceeds the number of observations. This is intentionally not an interpolating quantile: split-conformal calibration needs the observed k-th value to preserve the finite-sample coverage proof.