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.
Glossary
Quantile Regression

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.
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.
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.
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
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
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
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
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
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
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.
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.
Related Terms
Core concepts that form the foundation of quantile-based forecasting and uncertainty quantification in demand planning.
Pinball Loss Function
The asymmetric objective function that makes quantile regression possible. Unlike squared error loss which targets the conditional mean, pinball loss applies a tilted absolute penalty:
- For a target quantile τ, the loss is τ × |error| for over-predictions
- For under-predictions, the loss is (1-τ) × |error|
- At τ=0.5, pinball loss reduces to median regression (symmetric absolute loss)
- The tilt ratio determines whether the model errs toward over-forecasting or under-forecasting
This asymmetry is what forces the model to learn specific conditional quantiles rather than the conditional mean, enabling the construction of prediction intervals with calibrated coverage probabilities.
Prediction Intervals
A range constructed from two quantile forecasts that captures future demand with a specified probability. In retail forecasting:
- A 90% prediction interval uses the 5th and 95th percentiles as lower and upper bounds
- The interval width reflects forecast uncertainty — wider intervals indicate higher volatility
- Unlike confidence intervals (which estimate parameter uncertainty), prediction intervals account for inherent observation noise
- Quantile regression natively produces asymmetric intervals, which is critical for demand data that exhibits right-skewed distributions
Supply chain planners use these intervals to set safety stock levels: the upper quantile directly informs the inventory buffer needed to achieve a target service level.
Probabilistic Forecasting
The paradigm shift from point forecasts to full distributional outputs. Quantile regression is a foundational technique within this framework:
- A point forecast (e.g., 500 units) provides no risk information
- A probabilistic forecast outputs the entire conditional distribution P(Y|X)
- By estimating multiple quantiles (10th, 25th, 50th, 75th, 90th), quantile regression reconstructs this distribution non-parametrically
- No assumption of normality is required — the method captures arbitrary distribution shapes
This is essential for inventory optimization where the cost of understocking (lost sales) differs from overstocking (holding costs), requiring asymmetric risk assessment.
Continuous Ranked Probability Score
The CRPS is the gold-standard metric for evaluating probabilistic forecasts, directly measuring how well quantile regression outputs match observed outcomes:
- Compares the entire predicted cumulative distribution function to the actual observation
- A CRPS of zero indicates a perfect probabilistic forecast
- Penalizes both miscalibration (wrong spread) and sharpness (overconfident narrow intervals)
- More informative than point metrics like MAE because it rewards well-calibrated uncertainty quantification
When training quantile regression models, CRPS serves as a proper scoring rule that encourages the model to produce honest prediction intervals rather than artificially narrow ones.
Demand Sensing vs. Quantile Regression
Demand sensing uses real-time signals (POS data, weather, social trends) to refine short-term forecasts. Quantile regression enhances this approach:
- Traditional demand sensing produces point estimates vulnerable to sudden demand spikes
- Quantile regression on streaming data provides real-time prediction intervals that adapt to signal volatility
- During promotions or weather events, the upper quantile widens automatically, signaling increased uncertainty
- This enables dynamic safety stock adjustments rather than static buffer calculations
The combination allows supply chains to be both responsive (via demand sensing) and risk-aware (via quantile regression), reducing both stockouts and excess inventory simultaneously.
Hierarchical Quantile Coherence
When forecasting at multiple aggregation levels (SKU → category → region), quantile estimates must maintain mathematical coherence:
- Bottom-up reconciliation: Summing lower-level quantile forecasts does not preserve the target quantile at the aggregate level due to convolution effects
- Optimal reconciliation methods (e.g., MinT) must be extended to handle quantile-specific constraints
- Without reconciliation, aggregate prediction intervals can be miscalibrated, leading to incorrect safety stock allocations across the distribution network
- Modern approaches use copula-based or game-theoretic reconciliation to ensure coherent probabilistic forecasts at every hierarchy level
This is critical for global retailers managing inventory across thousands of SKUs and multiple distribution centers.

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