Skip to content
Statistics

What is the generalization of the median?

The Quantile.

datasciencetrivia.com

Card 1 of 259. Answer: The Quantile.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

The quantile. The median is the 0.5 quantile, with half the distribution below it. The p-quantile is the value q with a share p of the distribution at or below it, for any p between 0 and 1; for a continuous distribution, q = F⁻¹(p). Quartiles, deciles and percentiles are quantiles at fixed steps.

The median minimizes the sum of absolute errors, Σ |yᵢ − q|; the p-quantile minimizes the pinball loss, which weighs errors unevenly. With p = 0.9, predicting 10 too low costs 0.9 × 10 = 9 and 10 too high costs 0.1 × 10 = 1, so the best guess sits high, at the 90th percentile. Roger Koenker and Gilbert Bassett built quantile regression on this in 1978.

Quantiles describe the tails a mean hides, such as p99 latency. For a 90% prediction interval, fit models at p = 0.05 and p = 0.95 with the quantile loss in scikit-learn's gradient boosting or LightGBM. Sample quantile conventions differ, so tools can disagree slightly.

All questions