Quantile

A quantile is a cut point that divides an ordered dataset or a probability distribution into intervals holding equal shares of the observations or of the probability: the q-quantile is the value below which a fraction q of the data fall. The median is the 0.5 quantile, the quartiles are the 0.25, 0.5, and 0.75 quantiles, and the percentile is a quantile expressed on a 0 to 100 scale. Quantile is the umbrella term for all of them, and it also covers terciles (three groups), quintiles (five), deciles (ten), and any other split, such as the 0.99 quantile used to describe the slowest one percent of requests.

The quantile function is the inverse of the cumulative distribution function, and that single sentence is the most useful way to understand the concept: the cumulative distribution answers "what share of the data lie at or below this value?", and the quantile function answers the reverse question, "what value has this share at or below it?". For a theoretical distribution this gives exact quantiles, such as the standard normal distribution's 0.975 quantile of about 1.96, the number behind the familiar 95 percent confidence interval. For a sample, the quantile is read from the sorted data or from the cumulative frequency curve, which creates a practical difficulty: with n observations there are many reasonable ways to interpolate between neighbouring order statistics, and Rob Hyndman and Yanan Fan's 1996 survey catalogued nine different definitions in common use, which is why Python, R, and spreadsheets can return slightly different answers for the same quartile on small samples.

Quantiles are valued above all because they are robust and distribution-free: they depend only on the ordering of the data, so a single extreme value barely moves them, and they are meaningful for skewed or heavy-tailed data where means and standard deviations mislead. A set of quantiles describes an entire distribution without assuming its form: the minimum, quartiles, and maximum form the five-number summary behind John Tukey's box plot of 1977, and a quantile-quantile plot, which plots the quantiles of one distribution against those of another, is the standard visual check of whether data follow a normal distribution or whether two samples share a shape. Spread measures such as the interquartile range, the distance between the 0.25 and 0.75 quantiles, are built from quantiles, and the quartile and percentile entries cover those special cases in detail.

Sorted response times in milliseconds (n = 1,000)
lowest to highest
Choose the fraction q, then locate the value
q = 0.50
median, typical request
q = 0.95
95 percent of requests are at or below it
q = 0.99
tail latency, the slowest 1 percent begin here
Position about q × n in the sorted list
interpolate between neighbours (definition-dependent)
Report quantiles instead of the mean
robust to outliers and honest about the tail

The applications of quantiles are broad. In engineering and operations, service-level objectives are stated as quantiles of latency, such as the 99th percentile response time, since an average hides the slow experiences of a minority of users. In finance, value at risk is a quantile of the loss distribution, for example the loss exceeded on only one day in twenty. In statistics, critical values for hypothesis tests and confidence intervals are quantiles of reference distributions, and bootstrap confidence intervals are read as quantiles of resampled estimates. In machine learning, quantile regression, introduced by Roger Koenker and Gilbert Bassett in 1978, models a chosen conditional quantile by minimising an asymmetric absolute loss often called the pinball loss, giving prediction intervals without assuming a distribution; and quantile binning, quantile transformation, and quantile normalisation (used to make genomic microarray samples comparable) all use quantiles to rescale data.

Several pitfalls are common. Quantiles are not additive: the median of a combined dataset cannot be computed from the medians of its parts, nor can a tail percentile of a total be obtained by adding the percentiles of components, which is a frequent mistake when aggregating latency or risk. Extreme quantiles, such as the 0.999 quantile, need very large samples to estimate reliably, because few observations lie that far out. Quantiles from tiny samples are unstable and depend on the chosen definition. Averaging pre-computed percentiles across time windows or servers does not give the percentile of the pooled data. And in everyday speech, "being in the top quintile" is sometimes confused with "being in the top 20th percentile", which describes the opposite end of the ordering.

Read a quantile as a position in the ordering rather than a size: the value that leaves a stated fraction of the data behind it, the inverse of the cumulative distribution, robust to outliers by construction, and the single concept from which medians, quartiles, percentiles, and boxplots are all drawn.

Take quantile further

Ask the copilot about this term, or have our engineers assess it against your process.