Inferensys

Glossary

Quantile Regression

A statistical technique for estimating the conditional median or other quantiles of a response variable, providing a complete view of the relationship between variables beyond the conditional mean.
Incident responder handling AI system issue on laptop, logs and alerts visible, late night on-call session.
FORECASTING UNCERTAINTY

What is Quantile Regression?

Quantile regression is a statistical technique that models the relationship between independent variables and a specified conditional quantile of the dependent variable, enabling the construction of asymmetric prediction intervals.

Quantile regression estimates the conditional median or other percentiles of a response variable, moving beyond the mean-based focus of ordinary least squares. By minimizing the pinball loss function, it applies asymmetric weights to positive and negative residuals, allowing a model to learn distinct parameters for the 5th, 50th, or 95th percentile of a demand distribution.

In supply chain forecasting, this technique is critical for estimating safety stock requirements. While a mean forecast predicts expected demand, a 95th percentile quantile forecast defines the inventory level required to achieve a specific service level, directly quantifying the upside risk of a stockout without assuming a normal distribution of errors.

CONDITIONAL DISTRIBUTION MODELING

Key Characteristics of Quantile Regression

Unlike ordinary least squares which estimates the conditional mean, quantile regression models the relationship between independent variables and specific percentiles of the dependent variable, enabling a complete view of the conditional distribution.

01

Asymmetric Loss via Pinball Function

Quantile regression is trained by minimizing the pinball loss (also called quantile loss), an asymmetric function that penalizes errors differently depending on whether they fall above or below the predicted quantile.

  • For the 90th percentile, over-prediction is penalized 9x more than under-prediction
  • For the 10th percentile, under-prediction is penalized 9x more than over-prediction
  • The asymmetry parameter τ directly corresponds to the target quantile
  • This loss function is non-differentiable at zero, requiring linear programming or subgradient methods for optimization
τ vs 1-τ
Asymmetric Weight Ratio
02

Prediction Interval Construction

By fitting models at multiple quantiles simultaneously, practitioners can construct asymmetric prediction intervals that capture heteroscedastic uncertainty without assuming a parametric error distribution.

  • A 90% prediction interval is formed by the 5th and 95th percentile forecasts
  • Intervals naturally widen in regions of high variance and narrow where data is dense
  • Unlike Gaussian-based intervals, these can be asymmetric around the median
  • This approach is critical for inventory optimization, where the cost of understocking far exceeds overstocking
5th & 95th
Typical Interval Quantiles
03

Robustness to Outliers

Quantile regression, particularly at the median (τ=0.5), provides robust estimates that are resistant to extreme values in the response variable, unlike mean regression which can be arbitrarily distorted by a single outlier.

  • The median regression minimizes absolute errors rather than squared errors
  • Outliers in the target variable have bounded influence on coefficient estimates
  • This property is especially valuable in demand forecasting where promotional spikes or stockouts create extreme observations
  • No need for manual outlier removal or winsorization preprocessing steps
04

Heteroscedasticity Modeling

Quantile regression naturally captures heteroscedasticity—the phenomenon where the variance of the error term changes across the predictor space—without requiring explicit variance modeling.

  • Different quantile slopes reveal how predictor effects change across the distribution
  • For example, a price coefficient may be more negative at lower demand quantiles than upper ones
  • This reveals distributional effects that mean regression completely obscures
  • In retail, this shows whether promotions compress or expand demand variability
05

No Distributional Assumptions

Unlike maximum likelihood methods that assume a specific error distribution (e.g., Gaussian, Poisson), quantile regression is distribution-free, making valid inferences without parametric assumptions about the data-generating process.

  • No requirement for normally distributed residuals
  • Handles skewed, multimodal, or heavy-tailed conditional distributions
  • Valid inference relies on asymptotic theory rather than distributional assumptions
  • Particularly suited for intermittent demand patterns where zero-inflated distributions violate standard assumptions
06

Quantile Crossing Prevention

A practical challenge in quantile regression is quantile crossing, where a lower quantile prediction exceeds a higher one (e.g., the 10th percentile forecast is greater than the 90th). Modern implementations use constrained optimization to prevent this.

  • Monotonicity constraints ensure τ₁ < τ₂ implies Q(τ₁) ≤ Q(τ₂)
  • Non-crossing quantile regression uses simultaneous estimation with inequality constraints
  • Rearrangement post-processing can also correct crossing in fitted values
  • Essential for generating coherent prediction intervals in production forecasting systems
QUANTILE REGRESSION EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about using quantile regression for demand forecasting and uncertainty quantification in supply chain applications.

Quantile regression is a statistical technique that estimates the conditional quantiles of a response variable's distribution, rather than just its conditional mean. Unlike Ordinary Least Squares (OLS) , which minimizes the sum of squared residuals to predict the average outcome, quantile regression minimizes an asymmetric loss function called pinball loss. This allows it to model the entire conditional distribution. For example, a 95th percentile quantile regression model predicts the value below which 95% of observations fall, given the input features. This is critical for supply chain applications where the cost of under-prediction (a stockout) is far greater than over-prediction. OLS assumes homoscedasticity—that error variance is constant across all input values—while quantile regression makes no such assumption, naturally capturing heteroscedastic patterns where demand variability changes with the season or price point.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.