Concept

Quantile Regression

Quantile Regression, also known as robust/Theil-Sen, is a Statistics concept. The Library holds 2 implementations, each one a working definition you can pull into Quant.

Top Quantile Regression indicators

2 total

What is Quantile Regression?

Quantile regression fits a line to a chosen quantile of the data instead of its mean. Ordinary linear regression minimizes squared errors and delivers the conditional mean; quantile regression, formalized by Koenker and Bassett, minimizes a tilted absolute-error loss (the pinball or check loss) in which, for a target quantile q, points above the fit are weighted by q and points below by 1 minus q. Setting q to 0.5 yields median regression (least absolute deviations); q of 0.05 and 0.95 yield outer lines with roughly 5% of the data beyond each, in-sample.

On charts it shows up mainly as robust fits and channels. A median-slope fit resists the outlier bars that drag least-squares lines around, and outer quantile fits form a channel calibrated to how often price actually closed outside it, rather than assuming normality the way sigma-multiple versions of the linear-regression channel do. The Theil-Sen estimator, the median of the slopes over all pairs of points, is a related robust choice for the slope itself.

How traders use it

  • Robust trend measurement: median (q = 0.5) or Theil-Sen fits give slope estimates a single news spike cannot hijack, useful on gappy or thinly traded instruments.
  • Quantile channels: outer fits such as the 5th and 95th percentiles frame stretch zones whose in-sample exceedance rate is set by construction; out-of-sample the rate is not guaranteed, so excursions are context, not automatic fades.
  • Distribution-aware projection: fitting several quantiles at once sketches the whole conditional distribution of price or returns, which matters when the tails drive the decision more than the average does.

Related concepts · Regression & filtering

Concept family

Statistics

45 concepts mapped · 37 in the Library

Quantile Regression FAQ

How is quantile regression different from ordinary linear regression?

Ordinary least squares estimates the conditional mean by minimizing squared errors, which makes it outlier-sensitive and silent about the tails. Quantile regression estimates any chosen quantile by minimizing asymmetrically weighted absolute errors, so extreme bars pull on it far less, and fitting several quantiles (5th, 50th, 95th) describes the edges of the distribution as well as its center.

What is the Theil-Sen estimator?

A robust slope estimate: compute the slope between every pair of points in the window and take the median. Because a median ignores extreme values, a handful of outlier bars barely moves the fit, whereas least squares lets large deviations dominate through squaring. It is a common drop-in wherever a trend slope needs to survive spikes, gaps, and bad prints.

Build Quantile Regression your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.