Qm
Advanced

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 τ\tau (say τ=0.9\tau = 0.9 for the 90th percentile), the pinball loss penalizes underestimates by a factor of τ\tau and overestimates by a factor of 1τ1-\tau. 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 τ=0.5\tau = 0.5 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 τ=0.05\tau = 0.05 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 τ\tau and 1τ1-\tau, 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.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. Ask and answer about this concept. Off-topic gets removed.
  2. No homework dumps. Show what you tried first.
  3. Corrections are welcome. Cite a source when you claim an error.

Loading discussion…

Related concepts

Practice in interviews

Further reading

  • Koenker, Quantile Regression, ch. 1
ShareTwitterLinkedIn