/knowledge/quantile-regression
Quantile Regression
Ordinary regression models the average — but the average can hide everything that matters. Quantile regression models the whole distribution: how a predictor moves the bottom, the middle, and the top, not just the centre of mass.
- Studied
- Quantile RegressionAdvanced · the whole distribution
- When
- Statistics coursework
- Applied in
- When the spread matters
- Read / Refreshed
- ~13 min read2026-06-26
Ordinary regression answers one question: how does a predictor move the average of the outcome? That's useful — and it can hide almost everything that matters. The average effect of a policy might be small while it helps the top a lot and the bottom not at all; the spread of waiting times might widen with demand even as the mean holds steady. Quantile regression goes beyond the average: it models how a predictor affects any chosen point of the distribution — the median, the 10th percentile, the 90th — so you see the effect on the whole response, not just its centre of mass.
It's a distinct and surprisingly practical tool — and it links neatly to two neighbours: its loss function makes it naturally robust, and modelling the tails connects to extreme value theory and prediction intervals. This page is the idea, the clever loss that powers it, how to read its output, and where it earns its place.
01
Beyond the average
The limitation of mean regression is that the conditional mean is a single summary, and a single summary can't capture how a relationship changes across the distribution. Two scenarios with the same mean effect can be completely different: a predictor might shift everyone up equally, or lift the top while leaving the bottom flat, or increase the spread without moving the centre. Ordinary least-squares reports the same average for all three and is blind to the difference.
Yet the difference is often the whole point — in equity ("does this help the worst-off, or just the already-advantaged?"), in risk ("how bad is the bad case, not the typical case?"), and in service guarantees ("what's the 95th-percentile wait, not the average wait?"). Quantile regression is built to answer exactly these.
02
Modelling a conditional quantile
The idea is a direct generalisation. Where ordinary regression models the conditional mean of given , quantile regression models a conditional quantile — for example (the median), or (the 90th percentile) — as a function of the predictors. Fit it at several quantiles and you get a family of lines describing how the bottom, the middle, and the top of the outcome each respond to the predictors. You've modelled the whole conditional distribution, not just its mean.
03
The pinball loss
The mechanism is one elegant change of loss function. Ordinary regression minimises squared error (which targets the mean); quantile regression minimises an asymmetric absolute error — the pinball (or check) loss — that targets a chosen quantile:
The asymmetry is the whole trick. For , under-predictions (the true value is above the line) are penalised 9× harder than over-predictions — so the fitted line is pushed up until only ~10% of points lie above it: the 90th percentile. Tune and you target any quantile. And because it's built on absolute (not squared) error, quantile regression is naturally robust to outliers — median regression () is exactly least-absolute-deviations, the robust cousin of least-squares.
04
Reading the fanning lines
The real insight comes from fitting several quantiles at once and looking at the lines together:
If the quantile lines are roughly parallel, the predictor shifts the whole distribution equally (constant spread). If they fan apart, the spread grows with the predictor — heteroscedasticity — meaning the predictor affects not just the level but the variability. That fanning is invisible to a single mean line, and it's frequently the most important finding: "as X increases, outcomes don't just rise, they become more unequal."
05
What it's good for
Quantile regression earns its place wherever the spread or the tail matters as much as the centre:
- Prediction intervals — fit the 5th and 95th quantiles and you have a direct, honest interval ("90% of cases fall between these") — a close relative of conformal prediction.
- Risk & tails — modelling the 99th percentile of losses or delays directly, where the extreme is the concern, not the average.
- Equity analysis — does an effect differ for the bottom vs the top of the distribution? (Does a programme lift the worst-off, or only the already-doing-well?) The mean can't tell you; quantile regression can.
06
The honest limits
A couple of caveats keep it honest:
07
Where it shows up in my work
08
Refresh in 60 seconds
The conditional-quantile idea, the pinball-loss asymmetry, the heteroscedasticity reading, and the quantile-crossing / tail-data caveats reflect current quantile-regression references alongside coursework.