Quantile regression is a statistical technique that estimates the conditional median or other quantiles of a response variable, rather than the conditional mean. Unlike ordinary least squares regression, which predicts a single average outcome, quantile regression models the relationship between independent variables and a specified quantile of the dependent variable—such as the 95th percentile of lead time—providing a complete view of the conditional distribution.
Glossary
Quantile Regression

What is Quantile Regression?
A statistical technique for modeling the conditional quantiles of a response variable, enabling the construction of asymmetric prediction intervals for supply chain risk.
In supply chain analytics, this method is critical for constructing asymmetric prediction intervals that capture downside risk. By modeling the upper tail of the lead time distribution, planners can quantify worst-case delivery scenarios and set dynamic safety stock levels. The technique makes no assumptions about the parametric distribution of errors, making it robust to the heavy-tailed, skewed data common in supplier performance and transit time variability.
Key Characteristics of Quantile Regression
Unlike ordinary least squares regression which estimates the conditional mean, quantile regression models the conditional median or any specified quantile of the response variable. This enables the construction of asymmetric prediction intervals essential for supply chain risk management, where the cost of underestimating lead time far exceeds the cost of overestimating it.
Conditional Quantile Estimation
Quantile regression estimates the relationship between independent variables and a specified quantile (e.g., the 95th percentile) of the dependent variable. For a given quantile τ (where 0 < τ < 1), the model minimizes a weighted sum of absolute residuals:
- Asymmetric loss function: Over-predictions are penalized by weight τ, under-predictions by weight (1-τ)
- Median regression: Setting τ = 0.5 yields the conditional median, which is robust to outliers unlike the mean
- Full distributional view: Running the model at multiple τ values (0.05, 0.25, 0.50, 0.75, 0.95) reconstructs the entire conditional distribution of lead time
- The technique makes no assumptions about the homoscedasticity or normality of error terms, making it ideal for the skewed, heavy-tailed distributions common in logistics data
Asymmetric Prediction Intervals
By fitting separate quantile regression models at the 5th and 95th percentiles, planners obtain a 90% prediction interval that is inherently asymmetric. This captures real-world lead time dynamics where delays are unbounded but early deliveries have a physical floor:
- Lower bound (τ = 0.05): The optimistic scenario — the fastest plausible delivery time given current covariates
- Upper bound (τ = 0.95): The pessimistic scenario — the worst-case delivery time used for safety stock calculation
- Asymmetry ratio: The distance from the median to the upper bound is typically 2-3x larger than the distance to the lower bound, reflecting the long right tail of supplier delay distributions
- Unlike conformal prediction which wraps any model, quantile regression directly models the bounds as functions of input features, allowing the interval width to expand dynamically with risk factors like port congestion or monsoon season
Robustness to Outliers
Ordinary least squares regression is highly sensitive to extreme values because it minimizes squared errors, allowing a single anomalous shipment to exert disproportionate influence on the fitted line. Quantile regression at the median (τ = 0.50) minimizes absolute errors, providing inherent outlier resistance:
- Breakdown point: The median regression can tolerate up to 50% contaminated data before breaking down, compared to 0% for the mean
- Real-world relevance: A single supplier strike causing a 90-day delay will dramatically shift an OLS-based lead time forecast but leave the median regression estimate nearly unchanged
- Monotone equivariance: The model is equivariant to monotonic transformations of the response variable — modeling log(lead time) yields consistent quantile estimates
- This property is critical when ingesting raw logistics data that inevitably contains data entry errors, mis-scanned events, and genuine Black Swan disruptions that should not distort the central tendency of routine planning
Heteroscedasticity Handling
In supply chain data, the variance of lead time often increases with the mean — long-haul ocean freight exhibits far greater variability than local truck deliveries. This heteroscedasticity violates a core assumption of OLS but is naturally accommodated by quantile regression:
- Fanning prediction intervals: At τ = 0.05 and τ = 0.95, the interval width automatically expands for routes or suppliers with inherently higher variability
- Covariate-dependent dispersion: The model can capture how specific features (e.g., crossing the Suez Canal, reliance on a single carrier) amplify uncertainty without requiring a separate variance model
- No transformation required: Unlike OLS with robust standard errors, quantile regression directly models the quantile functions without post-hoc corrections
- This enables precise, context-aware dynamic buffer time calculations where the safety margin is a direct function of the current operational environment rather than a static historical average
Quantile Crossing Prevention
A practical challenge arises when fitting separate quantile regression models independently: the predicted 95th percentile may fall below the predicted 90th percentile for certain covariate values, a phenomenon called quantile crossing. Modern implementations address this through:
- Simultaneous quantile regression: Fitting all quantile levels jointly with non-crossing constraints ensures monotonicity — the predicted value at τ₁ is always ≤ the predicted value at τ₂ when τ₁ < τ₂
- Monotone neural networks: Deep learning architectures with constrained weights guarantee that the conditional quantile function is monotonically increasing in τ
- Rearrangement post-processing: A computationally efficient method that sorts independently estimated quantiles to restore monotonicity without refitting
- In production supply chain systems, non-crossing guarantees are essential for automated decision logic — a safety stock algorithm receiving crossed quantiles would produce nonsensical buffer recommendations, eroding planner trust in the AI system
Pinball Loss Function
The objective function minimized by quantile regression is the pinball loss (also called the quantile loss or check function), defined as:
- ρ_τ(u) = u · (τ − I(u < 0)), where u is the prediction residual and I is the indicator function
- For τ = 0.95, underestimating lead time (negative residual) incurs a penalty of 0.95 × |u|, while overestimating incurs only 0.05 × |u|
- This asymmetric penalty directly encodes the business cost of stockouts vs. holding costs: underestimating a critical component's lead time risks a production line stoppage costing millions, while overestimating merely ties up working capital in excess inventory
- The pinball loss generalizes to gradient boosting machines (e.g., LightGBM with objective='quantile') and deep learning frameworks, enabling quantile regression with the full power of modern non-linear function approximators
- By tuning τ to match the ratio of underage cost to total cost (critical ratio), the model output directly aligns with the news vendor problem optimal order quantity
Frequently Asked Questions
Clear, technical answers to the most common questions about using quantile regression for lead time risk modeling and asymmetric prediction intervals.
Quantile regression is a statistical technique that estimates the conditional median or other quantiles of a response variable, rather than modeling only the conditional mean. Unlike ordinary least squares (OLS), which minimizes the sum of squared residuals to predict an average outcome, quantile regression minimizes a weighted sum of absolute residuals—an asymmetrically weighted loss function called the pinball loss—to target specific percentiles of the response distribution.
This fundamental difference has critical implications for supply chain applications:
- OLS answers: "What is the average lead time I should expect?"
- Quantile regression answers: "What is the lead time I can guarantee with 95% confidence?"
For procurement planners, the 95th percentile estimate is far more actionable than the mean, as it directly informs safety stock calculations and delivery promise dates. Quantile regression also makes no assumptions about homoscedasticity (constant variance) or normality of errors, making it robust to the skewed, heavy-tailed distributions common in logistics data where delays are asymmetric—shipments can be days late but rarely days early.
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
Quantile regression does not operate in isolation. It is part of a broader toolkit for uncertainty quantification and risk-aware forecasting. These related concepts are essential for building robust predictive lead time systems.
Prediction Intervals
The direct output of quantile regression in a forecasting context. By estimating the 5th and 95th quantiles, you construct a 90% prediction interval that captures the range within which a future lead time is expected to fall. Unlike confidence intervals, which estimate parameter uncertainty, prediction intervals account for the inherent variability of a single future observation. This asymmetric band is critical for setting dynamic safety stock levels.
Conformal Prediction
A model-agnostic wrapper that provides distribution-free prediction intervals with a formal guarantee of coverage. While quantile regression models the conditional quantiles directly, conformal prediction uses a held-out calibration set to measure the residuals of any underlying model. It ensures that the true value falls within the band at a user-specified rate (e.g., 95%) without assuming a specific error distribution, making it a powerful complement to quantile regression.
Pinball Loss Function
The asymmetric loss function used to train quantile regression models. For a given quantile τ (e.g., 0.95), the pinball loss penalizes under-prediction more heavily than over-prediction. Specifically:
- For τ = 0.95, a positive residual (actual > forecast) is weighted 19x more than a negative one.
- This asymmetry forces the model to learn the desired conditional quantile rather than the conditional mean, which is the result of minimizing symmetric squared error.
Lead Time Variability
The statistical dispersion that quantile regression is designed to capture. High lead time variability from a supplier—measured by standard deviation or interquartile range—directly inflates the width of the prediction interval. Quantile regression models this heteroskedasticity by allowing the spread to change with covariates (e.g., a specific carrier may have a wider 95th quantile during peak season), providing a more nuanced risk profile than a constant-variance model.
Dynamic Buffer Time
The operational decision that consumes the output of quantile regression. A dynamic buffer is calculated as the difference between the high quantile forecast (e.g., τ = 0.95) and the median forecast (τ = 0.50). Instead of a static safety lead time, this buffer adapts in real-time to supplier risk, seasonality, and geopolitical events. It translates statistical uncertainty into a concrete, risk-adjusted promise date for the customer.
Censored Data Handling
A critical challenge in lead time modeling where quantile regression offers a distinct advantage. When a shipment is still in transit, its true delivery time is right-censored—we only know it exceeds the current elapsed time. Standard mean regression requires imputation or discarding this data. Quantile regression, particularly with censored quantile regression estimators, can incorporate this partial information to update risk estimates for active shipments without bias.

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