Skip to main content

quantile_type7

Function quantile_type7 

Source
fn quantile_type7(sorted: &[f64], p: f64) -> f64
Expand description

Compute a quantile using R’s type 7 algorithm (the default).

For sorted data of length n and probability p: h = (n - 1) * p, result = x[floor(h)] + (h - floor(h)) * (x[ceil(h)] - x[floor(h)])