Sample Quantile Estimators and Plotting Positions
There is no single correct formula for 'the 90th percentile of a sample' — different quantile estimators and plotting-position rules give slightly different answers, and the choice matters most in the small samples and tail regions quants care about.
Prerequisites: Quantile Functions and the Inverse CDF, Standard Deviation
Ask ten different statistics packages for the 95th percentile of the same 40-day P&L series and, in the tails, you can get ten slightly different numbers. That's not a bug — there are at least nine officially recognized ways to estimate a quantile from a finite sample, and they disagree by construction because a quantile is a property of a smooth underlying distribution, while your data is a finite, lumpy set of points. Sample quantile estimators are the rules for bridging that gap, and plotting positions are the closely related rules for deciding what quantile a given sorted observation "represents" on a probability plot.
An analogy: measuring where the 9th runner "really" finished
Imagine 12 runners cross a finish line and you want to know the finishing-time value that "90% of runners are faster than." With 12 runners, no one runner sits exactly at the 90th percentile — the 90% mark falls somewhere between the 10th and 11th finisher. Do you just take the 11th runner's time? Average the 10th and 11th? Weight the average toward whichever is closer to the true 90% mark? Every reasonable choice is a different quantile estimator, and with only 12 runners, the choice can swing your answer meaningfully. With 12,000 runners, the different rules nearly agree, because there's a runner right there at (or very near) the 90% mark.
The mechanics, one piece at a time
Sort your observations to get order statistics . A plotting position assigns each sorted observation a probability — the "quantile level it represents" — using a formula like
where is a constant between 0 and 1 that differs by convention: gives the classic rule, gives the Blom formula favored for normal-probability plots, and gives , the Weibull formula. In plain English: each sorted data point is assigned a "share" of the 0-to-1 probability line, and the different formulas just disagree, mostly at the edges, about exactly how much share the smallest and largest points should get. To get a quantile estimate for a specific target level (say the 95th percentile), you invert this — find where falls between two 's and interpolate between the corresponding values, usually linearly.
Worked example 1: the 90th percentile of 10 P&L observations
Take 10 sorted daily P&L figures (in $000s): −8, −5, −3, −1, 0, 1, 2, 4, 6, 9. Using the common plotting position with : the 10th point () represents , and the 9th point () represents . To estimate the 90th percentile (), interpolate linearly between (value 6) and (value 9): the target is halfway between, so the estimate is , i.e. $7,500. A different convention (say ) would place at and at , giving a slightly different interpolated answer near $7,900 — a difference of roughly $400 purely from the choice of formula, on identical data.
Worked example 2: why the choice barely matters at scale
Now repeat the exercise on 1,000 sorted daily P&L observations. The gap between adjacent order statistics near the 90th percentile is tiny — often a few dollars — so whichever plotting-position convention you use, the interpolated 90th-percentile estimate lands within a rounding error of the others. With , and differ by at most in probability terms, which barely nudges the interpolation. The lesson: estimator choice is a real source of disagreement in small samples and matters most exactly where risk desks operate — thin tails, short lookback windows — and becomes nearly irrelevant with large, dense samples.
What this means in practice
Quantile estimator choice quietly affects VaR estimates, backtesting thresholds, and any percentile-based risk limit computed from a short historical window — see Value at Risk. Most statistical software defaults to one convention (R's default is type 7, roughly the linear-interpolation rule used above) without telling you, so two teams computing "the same" 99th-percentile VaR from the same data can get different numbers just from differing software defaults. When precision at the tail matters, state which quantile estimator you used, and prefer methods built for tail estimation, like extreme value theory, over naive sample quantiles when the sample is small.
A sample quantile is not a single well-defined number — it depends on a plotting-position convention for assigning probability levels to sorted data and interpolating between them, and different reasonable conventions can disagree meaningfully in small samples, especially near the tails.
Don't assume "the 95th percentile of my data" means the same thing across two analyses unless you've confirmed both used the same quantile estimator. This is especially dangerous when comparing a small backtest sample's VaR breach rate against a regulatory or textbook threshold computed under a different convention — the mismatch can silently make a compliant model look like it's breaching, or vice versa, purely from an estimator choice neither side stated explicitly.
Related concepts
Practice in interviews
Further reading
- Hyndman & Fan, Sample Quantiles in Statistical Packages, The American Statistician (1996)