Quantile regression is a statistical method that models the relationship between independent variables and a specified quantile (e.g., median, 90th percentile) of the dependent variable. Unlike ordinary least squares regression, which estimates the conditional mean, quantile regression estimates the conditional quantile function, providing a more comprehensive analysis of the relationship between variables, especially when the data exhibits heteroscedasticity or non-normal error distributions.
Glossary
Quantile Regression

What is Quantile Regression?
Quantile regression is a statistical technique that estimates the conditional median or other quantiles of a response variable, providing a complete view of the relationship between variables beyond the conditional mean.
In supply chain demand forecasting, quantile regression is used to construct prediction intervals by estimating specific quantiles of future demand. For example, the 95th quantile forecast provides an upper bound where actual demand is expected to fall below 95% of the time, directly informing safety stock calculations. The model is trained by minimizing the pinball loss function, which asymmetrically penalizes over-prediction and under-prediction to target the desired quantile.
Core Characteristics
The foundational statistical technique that enables probabilistic demand forecasting by modeling the conditional quantiles of a response variable, directly quantifying uncertainty at specific service levels.
Asymmetric Loss via Pinball Loss
Unlike ordinary least squares which minimizes symmetric squared errors, quantile regression minimizes the pinball loss (tilted absolute value) function. This asymmetric loss penalizes over-prediction and under-prediction differently based on the target quantile τ.
- For the median (τ=0.5), the penalty is symmetric
- For the 95th percentile (τ=0.95), under-prediction is penalized 19x more than over-prediction
- This directly encodes the business cost of stockouts vs. overstocking into the model training objective
Distribution-Free Estimation
Quantile regression makes no parametric assumptions about the underlying error distribution. It does not require the residuals to be normally distributed, homoscedastic, or independent.
- Works robustly with heavy-tailed demand distributions common in intermittent spare parts
- Handles heteroscedasticity where forecast variance changes with the level of demand
- Provides valid inference without needing to specify a likelihood function
Building Prediction Intervals
By fitting multiple quantile regressions simultaneously, you construct a prediction interval with a specified coverage probability. A 90% prediction interval is formed by the 5th and 95th conditional quantiles.
- The width of the interval directly reflects the model's uncertainty at each point
- Intervals can be asymmetric, capturing skewed demand distributions
- Service level targets (e.g., 98% fill rate) map directly to specific quantiles
Interpretable Covariate Effects
Quantile regression reveals how covariates affect different parts of the demand distribution, not just the mean. A promotion might lift median demand by 10% but the 90th percentile by 40%.
- Identifies predictors that increase demand volatility without shifting the mean
- Detects heterogenous treatment effects across the distribution
- Provides richer operational insights than mean regression for inventory decisions
Linear Programming Formulation
The quantile regression optimization problem can be expressed as a linear program, making it computationally tractable for large-scale supply chain datasets with thousands of SKUs.
- Solved efficiently using simplex or interior-point methods
- The dual formulation provides direct estimates of the conditional density
- Extends naturally to regularized variants (Lasso, Ridge) for high-dimensional feature spaces
Connection to Expectile Regression
While quantile regression minimizes absolute asymmetric loss, expectile regression minimizes asymmetric squared loss. Expectiles are more sensitive to extreme values and provide an alternative characterization of the distribution.
- Expectiles are coherent risk measures; quantiles are not
- Useful when the cost of extreme errors grows quadratically
- Both techniques can be combined for robust probabilistic forecasting ensembles
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Explore the core concepts behind quantile regression, a powerful statistical technique for modeling the conditional quantiles of a response variable, essential for building robust prediction intervals in probabilistic demand forecasting.
Quantile regression is a statistical technique that estimates the conditional median or other quantiles of a response variable, modeling the relationship between predictors and specific points in the outcome distribution. Unlike Ordinary Least Squares (OLS), which models the conditional mean and assumes a constant effect across the distribution, quantile regression provides a complete view of the covariate effects by allowing them to vary at different quantiles. It achieves this by minimizing an asymmetric loss function, such as the pinball loss, which penalizes over-prediction and under-prediction differently. This makes it inherently robust to outliers and heteroscedasticity, as it does not rely on the strict normality assumptions of OLS. For supply chain applications, this means you can directly model the 95th percentile of demand to set safety stock levels, rather than just forecasting the average demand.
Related Terms
Master the ecosystem of techniques that surround quantile regression for building robust, service-level-driven demand forecasts.
Prediction Intervals
The primary output consumers of quantile regression in supply chain contexts. A prediction interval defines a range [L, U] expected to contain the actual future demand with a specified coverage probability.
- A 90% interval is constructed from the τ=0.05 and τ=0.95 quantiles
- Unlike confidence intervals, prediction intervals account for both model uncertainty and inherent noise
- Critical for setting safety stock levels at specific service level targets
Continuous Ranked Probability Score
The gold-standard metric for evaluating probabilistic forecasts, including those produced by quantile regression. CRPS measures the integrated squared difference between the predicted cumulative distribution function and the empirical observation.
- A strictly proper scoring rule that encourages honest probability estimates
- Generalizes the Mean Absolute Error to probabilistic predictions
- Penalizes both poor calibration and low sharpness in a single value
Aleatoric vs. Epistemic Uncertainty
Quantile regression naturally captures aleatoric uncertainty—the irreducible noise in demand data. However, it does not automatically separate this from epistemic uncertainty, which stems from limited training data.
- Aleatoric: Random demand fluctuations that persist even with infinite data
- Epistemic: Model ignorance that shrinks as more training samples are collected
- Advanced approaches like Deep Ensembles or Bayesian quantile regression disentangle both sources for more honest prediction intervals
Safety Stock Optimization
The downstream business application that directly consumes quantile regression outputs. Given a demand quantile forecast at a target service level (e.g., 95%), safety stock is calculated as the buffer above the mean forecast.
- Safety Stock = Q(τ) - Mean Forecast, where τ matches the desired fill rate
- Integrates with the newsvendor model to balance holding costs against stockout penalties
- Dynamic safety stock policies re-estimate quantiles daily as demand patterns shift

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us