AI Glossary / Statistics and probability / Beginner

Quantile

Definition

A quantile usually means a value marking a specified position in an ordered distribution, such as the median or the 90th percentile. It describes where a chosen fraction of probability or observations lies. The supplied Google Machine Learning glossary also uses quantile to mean a bucket formed by quantile bucketing. These related meanings should be distinguished: a quantile threshold is a boundary value, while a quantile bucket is a group of observations between boundaries.

What it means

Quantiles describe a distribution through relative position rather than through an average alone. The 0.50 quantile is a median, and the 0.90 quantile is commonly called the 90th percentile. Quartile thresholds correspond to probabilities 0.25, 0.50, and 0.75.

For a population distribution with cumulative distribution function F, a common definition for 0 < p < 1 is Q(p) = inf{x: F(x) >= p}. This convention handles discrete distributions as well as continuous ones. For finite samples, multiple accepted calculation rules exist, including selecting order statistics and interpolating between them. Consequently, two programs can report slightly different sample quantiles without either necessarily being wrong.

How it works

Specify the variable, population or dataset, probability level, and calculation convention. For a sample, sort the nonmissing observations and apply the selected order-statistic or interpolation rule. Record how missing values, weights, and ties are treated.

One common interpolation convention uses position h = 1 + (n - 1)p in a sorted sample of n values. If h falls between positions j and j + 1, interpolate by the fractional part of h. Another convention uses the inverse empirical distribution, selecting the observation at position ceiling(np) for positive p. These rules estimate the same population concept but can differ in small datasets.

When creating quantile buckets, use appropriate thresholds to divide observations into approximately equal-sized groups. Ties can prevent equal counts if identical values must stay together. For reporting, name the threshold and its units; for bucketing, name the interval and boundary rules. Do not silently substitute a group label for the numerical threshold.

Three practical examples

  • A service team reports the median and 90th-percentile response times to distinguish typical service from slower experiences.
  • An AI monitoring dashboard compares prediction-error quantiles across deployment periods while preserving a consistent calculation convention.
  • An analyst groups customers into spending quantile buckets, explicitly separating the bucket labels from the monetary cutoffs defining them.

Think of it this way

Imagine lining up parcels from lightest to heaviest and marking a position along the line. The quantile threshold is the weight associated with that position under the chosen rule. A bucket is a stretch of the line between marks. Equal numbers of parcels in stretches do not imply equal differences in weight, and several parcels with the same weight can make exact splitting awkward.

Worked example

In an original example, eight sorted response times are 2, 4, 5, 7, 9, 12, 18, and 30 minutes. Use the interpolation rule h = 1 + (n - 1)p.

For p = 0.25, h = 1 + 7 × 0.25 = 2.75. Interpolating between the second and third values gives 4 + 0.75(5 - 4) = 4.75 minutes. For p = 0.50, h = 4.5, giving 7 + 0.5(9 - 7) = 8 minutes. For p = 0.75, h = 6.25, giving 12 + 0.25(18 - 12) = 13.5 minutes.

Under the inverse-empirical-distribution convention, the same probabilities select positions ceiling(8p): positions 2, 4, and 6. The corresponding values are 4, 7, and 12 minutes. The difference comes from the stated rules, not changed observations. An interpolated threshold also need not equal an observed value or have exactly p of the sample strictly below it. These details matter when reconciling reports from different systems.

Illustrative case study

Fictional case study: Maple Operations compares latency dashboards from two teams. Their reported upper quartiles differ slightly even though both use the same observations.

The teams discover different sample-quantile conventions, agree on one for shared reporting, and document it beside the metric definition. They retain the full distribution for investigating unusually slow events. This fictional case illustrates reproducibility in summaries, not a real performance improvement or evidence that either original software calculation was defective.

Common misconceptions and mistakes

A percentile is a location in a distribution, not a percentage increase in the measured quantity. The 90th percentile of waiting time is measured in time units; it is not 90% of the largest observed wait.

Quantiles also do not necessarily divide a finite dataset into perfectly equal counts, especially with ties or interpolation. Another mistake is assuming that a high percentile is a maximum or a hard service guarantee. Sample quantiles estimate population behavior and can be uncertain, particularly in the tails. Finally, an unconditional quantile of all outcomes differs from a conditional quantile predicted for a specific set of features.

Business use

Quantiles help organizations communicate distributions that an average can hide. They are useful for service performance, error analysis, and comparisons where unusually high or low values matter.

Use consistent definitions across periods, and retain sample sizes and collection windows. A stable median can coexist with worsening upper-tail performance. Conversely, a changed quantile may reflect changes in the population mix rather than deterioration for every user. When thresholds drive decisions, assess their sampling uncertainty and avoid estimating extreme percentiles from too little data. Report units and the calculation convention so readers can reproduce the result.

People also ask

Is a quantile always an observed value?

No. Interpolation can produce a value between observations.

Why do two programs give different quartiles?

They may use different accepted sample-quantile conventions.

Is a quantile bucket the same as its threshold?

No. The bucket contains observations; the threshold marks a boundary.

Check your understanding

Under h = 1 + (n - 1)p, what is the median of the eight response times in the example?

Answer: Position 4.5 lies halfway between 7 and 9, so the median estimate is 8 minutes.

Related terms

  • Percentile
  • Median
  • Quartile
  • Order statistic
  • Cumulative distribution function
  • Quantile bucketing
  • Empirical distribution
  • interpolation
  • conditional quantile

Learn next

Compare quantile thresholds with bucket membership. Practice multiple sample conventions, then study empirical distributions, uncertainty in quantile estimates, and conditional quantile regression.

  • Quantile Regression

More in Statistics and probability

  • Pyrrho's lemma - Pyrrho's lemma is a result about the vulnerability of regression conclusions to a deliberately selected additional regressor.
  • Q-value (statistics) - A q-value is a measure of statistical significance designed for multiple hypothesis testing.
  • Qualitative data - Qualitative data describe types, qualities, or categories rather than measured amounts or counts.
  • Quantile regression averaging - Quantile regression averaging, or QRA, combines forecasts by using them as inputs to a quantile regression model.
  • Quantitative data - Quantitative data represent measured amounts or counts expressed numerically.
  • Questionnaire error - Questionnaire error is the part of survey measurement error attributable to a questionnaire's wording, structure, or form.

Sources

Google's glossary uses quantile for a quantile-bucketing group: https://developers.google.com/machine-learning/glossary#quantile

R's official documentation specifies sample-quantile algorithms, including inverse empirical and interpolated conventions: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html

The terminology difference is explicit. The numerical comparisons and fictional case are original and independently checked.

Previous: Quantification Next: Quantile bucketing

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer