Pinball Loss and Quantile Networks
Instead of asking a network to guess the average outcome, quantile networks ask it to guess a threshold that a chosen fraction of outcomes will fall below — trained with an asymmetric loss that penalizes overshooting and undershooting differently.
Prerequisites: The Multilayer Perceptron, Quantile Regression Forests
Predicting the average outcome is the wrong goal whenever the actual question is about risk — a risk manager rarely cares "what's the expected loss," they care "what loss will only be exceeded 5% of the time." A pinball-loss quantile network is trained to answer that second kind of question directly, producing a threshold value for a chosen percentile rather than a single average guess.
The analogy: setting a price you're okay being wrong about, one-sided
Imagine setting a price for buying insurance against a bad outcome, where you're comfortable being wrong on one side (paying slightly more than needed) but not on the other (being caught badly underinsured). If you want to be right roughly 90% of the time that your threshold isn't exceeded, you should deliberately set it a bit high — being wrong low is far more costly than being wrong high. Quantile regression trains a model to find exactly that threshold: the value such that a target fraction of outcomes fall below it, for whichever (say 0.1, 0.5, or 0.9) you choose.
The pinball loss
In words: if the actual outcome comes in above the predicted quantile (an undershoot), the penalty is times the gap; if it comes in below (an overshoot), the penalty is times the gap. For , undershooting is penalized nine times more heavily than overshooting per unit of error, which is exactly why the network learns to set high enough that only 10% of outcomes exceed it — that's the only way to make the heavily-weighted undershoot case rare. Setting recovers ordinary median regression, where both directions cost the same.
Worked example 1: the asymmetry in numbers
Let , true outcome . Compare a prediction (undershoot, ) against (overshoot, ).
Both predictions miss by the same amount, 2 units, but undershooting costs nine times as much as overshooting under . That asymmetry is precisely what pushes a trained model toward the high side — a network minimizing average pinball loss across many such examples learns to systematically bias its predictions upward until only about 10% of true outcomes exceed them.
Worked example 2: fitting a median versus a 90th percentile
Five residuals from a small dataset: . For (median), the loss-minimizing constant prediction is the sample median, : total pinball loss . For , the loss-minimizing constant is the empirical 90th percentile, roughly (between and , closer to ): checking , undershoots are contributing , and the one overshoot contributes , total — moving toward trades a small increase in the rare overshoot penalty against a larger decrease across all four undershoots, which is exactly the calculation the training loss does automatically at every gradient step.
The two linear arms of the pinball loss meet at with different, asymmetric slopes — steeper on the side the loss punishes harder — which is the whole mechanism forcing the model away from the ordinary mean.
The pinball loss penalizes undershooting and overshooting a target quantile asymmetrically, with weights and . A network trained to minimize it converges toward the true -th percentile of the outcome distribution, not the mean, and training several networks (or output heads) at different values builds an entire predictive interval, not just a point forecast.
What this means in practice
Quantile networks are the direct neural-network route to Value-at-Risk-style forecasts and prediction intervals used for position sizing and stop placement — training separate output heads at gives a lower bound, median, and upper bound from one model, without assuming the residuals are Gaussian, which the older mean-plus-fixed-standard-deviation approach implicitly does.
The common mistake is training multiple quantile heads independently and then treating their outputs as automatically consistent — nothing in the pinball loss itself prevents the 90th-percentile head from predicting a lower value than the 50th-percentile head on some input ("quantile crossing"), which is a nonsensical, contradictory prediction. Enforcing monotonicity across quantiles (e.g. by construction, predicting successive gaps rather than each quantile independently) is a separate step, not something the basic pinball-loss setup guarantees on its own.
Related concepts
Practice in interviews
Further reading
- Koenker, Quantile Regression (2005)
- Koenker & Bassett, Regression Quantiles (1978)