The Pinball Loss
The asymmetric loss function used to train quantile regression models, penalizing over- and under-prediction differently depending on which quantile you're targeting.
Ordinary regression trains a model to predict the mean of a target by penalizing over- and under-predictions equally, usually with squared error. If you want to predict the 90th percentile of next-day returns instead of the mean, you need a loss that penalizes the two kinds of mistakes asymmetrically — and that's what the pinball loss (also called quantile loss) does.
For a target quantile (say for the 90th percentile), the pinball loss penalizes underestimates by a factor of and overestimates by a factor of . In words: when you're targeting a high quantile like 0.9, underpredicting is punished nine times as heavily as overpredicting, which pushes the model to sit high enough that only 10% of actual outcomes exceed it — exactly the property a 90th-percentile estimate should have. At the two penalties are equal, which reduces the pinball loss to ordinary absolute-error loss and recovers median regression.
A desk building a value-at-risk model might train a gradient-boosted tree with pinball loss at to predict the 5th percentile of daily P&L directly, rather than assuming a normal distribution and backing out the quantile from a mean and standard deviation — letting the model learn the actual shape of the tail from data instead.
The pinball loss penalizes under- and over-prediction asymmetrically by and , which is exactly what's needed to train a model whose output is a specific quantile rather than a mean — it's the workhorse loss function behind quantile regression and quantile-based value-at-risk models.
Practice in interviews
Further reading
- Koenker, Quantile Regression, ch. 1