Inferensys

Glossary

Quantile Regression

A statistical technique that estimates the conditional median or other quantiles of a response variable, enabling the construction of asymmetric prediction intervals for lead time risk.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
PREDICTIVE LEAD TIME ANALYTICS

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.

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.

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.

ASYMMETRIC UNCERTAINTY MODELING

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.

01

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
τ ∈ (0,1)
Quantile Range
02

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
2-3x
Upper vs. Lower Bound Asymmetry
03

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
50%
Breakdown Point (Median)
04

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
τ-specific
Variance Modeling
05

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
τ₁ < τ₂
Monotonicity Constraint
06

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
τ/(1-τ)
Asymmetric Cost Ratio
QUANTILE REGRESSION EXPLAINED

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.

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.