Quantile regression

Statistical modeling technique

Part of a series on

Regression analysis
Models

* Linear regression
* Simple regression
* Polynomial regression
* General linear model

* Generalized linear model
* Vector generalized linear model
* Discrete choice
* Binomial regression
* Binary regression
* Logistic regression
* Multinomial logistic regression
* Mixed logit
* Probit
* Multinomial probit
* Ordered logit
* Ordered probit
* Poisson

* Multilevel model
* Fixed effects
* Random effects
* Linear mixed-effects model
* Nonlinear mixed-effects model

* Nonlinear regression
* Nonparametric
* Semiparametric
* Robust
* Quantile
* Isotonic
* Principal components
* Least angle
* Local
* Segmented

* Errors-in-variables

Estimation

* Least squares
* Linear
* Non-linear

* Ordinary
* Weighted
* Generalized
* Generalized estimating equation

* Partial
* Total
* Non-negative
* Ridge regression
* Regularized

* Least absolute deviations
* Iteratively reweighted
* Bayesian
* Bayesian multivariate
* Least-squares spectral analysis

Background

* Regression validation
* Mean and predicted response
* Errors and residuals
* Goodness of fit
* Studentized residual
* Gauss–Markov theorem

* Mathematics portal

* v
* t
* e

Quantile regression is a type of regression analysis used in statistics and econometrics. Whereas the method of least squares estimates the conditional mean of the response variable across values of the predictor variables, quantile regression estimates the conditional median (or other quantiles) of the response variable. [There is also a method for predicting the conditional geometric mean of the response variable, [1].] Quantile regression is an extension of linear regression used when the conditions of linear regression are not met.

Example for quantile regression

## Advantages and applications

[edit]

One advantage of quantile regression relative to ordinary least squares regression is that the quantile regression estimates are more robust against outliers in the response measurements. However, the main attraction of quantile regression goes beyond this and is advantageous when conditional quantile functions are of interest. Different measures of central tendency and statistical dispersion can be used to more comprehensively analyze the relationship between variables.[2]

In ecology, quantile regression has been proposed and used as a way to discover more useful predictive relationships between variables in cases where there is no relationship or only a weak relationship between the means of such variables. The need for and success of quantile regression in ecology has been attributed to the complexity of interactions between different factors leading to data with unequal variation of one variable for different ranges of another variable.[3]

Another application of quantile regression is in the areas of growth charts, where percentile curves are commonly used to screen for abnormal growth.[4][5]

## History

[edit]

The idea of estimating a median regression slope, a major theorem about minimizing sum of the absolute deviances and a geometrical algorithm for constructing median regression was proposed in 1760 by Ruđer Josip Bošković, a Jesuit Catholic priest from Dubrovnik.[2]: 4 [6] He was interested in the ellipticity of the earth, building on Isaac Newton's suggestion that its rotation could cause it to bulge at the equator with a corresponding flattening at the poles.[7] He finally produced the first geometric procedure for determining the equator of a rotating planet from three observations of a surface feature. More importantly for quantile regression, he was able to develop the first evidence of the least absolute criterion and preceded the least squares introduced by Legendre in 1805 by fifty years.[8]

Other thinkers began building upon Bošković's idea such as Pierre-Simon Laplace, who developed the so-called "methode de situation." This led to Francis Edgeworth's plural median[9] \- a geometric approach to median regression - and is recognized as the precursor of the simplex method.[8] The works of Bošković, Laplace, and Edgeworth were recognized as a prelude to Roger Koenker's contributions to quantile regression.

Median regression computations for larger data sets are quite tedious compared to the least squares method, for which reason it has historically generated a lack of popularity among statisticians, until the widespread adoption of computers in the latter part of the 20th century.

## Background: quantiles

[edit]

Quantile regression expresses the conditional quantiles of a dependent variable as a linear function of the explanatory variables. Crucial to the practicality of quantile regression is that the quantiles can be expressed as the solution of a minimization problem, as we will show in this section before discussing conditional quantiles in the next section.

### Quantile of a random variable

[edit]

Main article: Quantile function

Let  Y {\displaystyle Y} be a real-valued random variable with cumulative distribution function F Y ( y ) = P ( Y ≤ y ) {\displaystyle F_{Y}(y)=P(Y\leq y)} . The  τ {\displaystyle \tau } th quantile of Y is given by

q Y ( τ ) = F Y − 1 ( τ ) = inf { y : F Y ( y ) ≥ τ } {\displaystyle q_{Y}(\tau )=F_{Y}^{-1}(\tau )=\inf \left\\{y:F_{Y}(y)\geq \tau \right\\}}

where  0 < τ < 1 {\displaystyle 0<\tau <1} .

Define the loss function as

ρ τ ( u ) = u ( τ − I ( u < 0 ) ) = { ( τ − 1 ) u , if  u < 0 , τ u , if  u ≥ 0 , {\displaystyle \rho _{\tau }(u)=u(\tau -\mathbb {I} _{(u<0)})={\begin{cases}(\tau -1)u,&{\text{if }}u<0,\\\\\tau u,&{\text{if }}u\geq 0,\end{cases}}}

where  0 < τ < 1 {\displaystyle 0<\tau <1} ,  I ( ⋅ ) {\displaystyle \mathbb {I} (\cdot )} is an indicator function. It is observed that  τ > ( 1 − τ ) {\displaystyle \tau >(1-\tau )} for  τ > 0.5 {\displaystyle \tau >0.5} , and  τ < ( 1 − τ ) {\displaystyle \tau <(1-\tau )} for  τ < 0.5 {\displaystyle \tau <0.5} . The intuition is that for higher quantiles ( τ > 0.5 {\displaystyle \tau >0.5} ), we penalize the positive residuals more than negative residuals, and vice versa, and the loss is unsymmetric. However, for  τ = 0.5 {\displaystyle \tau =0.5} the penalization is symmetric (hence, this results in a median estimator). A specific quantile can be found by minimizing the expected loss of  Y − u {\displaystyle Y-u} with respect to  u {\displaystyle u} :[2](pp. 5–6):

q Y ( τ ) = arg min u E ( ρ τ ( Y − u ) ) = arg min u ∫ − ∞ + ∞ ρ τ ( y − u ) d F Y ( y ) = arg min u { ( τ − 1 ) ∫ − ∞ u ( y − u ) d F Y ( y ) + τ ∫ u ∞ ( y − u ) d F Y ( y ) } . {\displaystyle {\begin{array}{lll}q_{Y}(\tau )&=&{\underset {u}{\mbox{arg min}}}\mathbb {E} (\rho _{\tau }(Y-u))\\\&=&{\underset {u}{\mbox{arg min}}}\int _{-\infty }^{+\infty }\rho _{\tau }(y-u)dF_{Y}(y)\\\&=&{\underset {u}{\mbox{arg min}}}{\biggl \\{}(\tau -1)\int _{-\infty }^{u}(y-u)dF_{Y}(y)+\tau \int _{u}^{\infty }(y-u)dF_{Y}(y){\biggr \\}}.\end{array}}}

This can be shown by computing the derivative of the expected loss with respect to  u {\displaystyle u} via an application of the Leibniz integral rule, setting it to 0, and letting  q τ {\displaystyle q_{\tau }} be the solution of

0 = ( 1 − τ ) ∫ − ∞ q τ d F Y ( y ) − τ ∫ q τ ∞ d F Y ( y ) . {\displaystyle 0=(1-\tau )\int _{-\infty }^{q_{\tau }}dF_{Y}(y)-\tau \int _{q_{\tau }}^{\infty }dF_{Y}(y).}

This equation reduces to

0 = F Y ( q τ ) − τ , {\displaystyle 0=F_{Y}(q_{\tau })-\tau ,}

and then to

F Y ( q τ ) = τ . {\displaystyle F_{Y}(q_{\tau })=\tau .}

If the solution  q τ {\displaystyle q_{\tau }} is not unique, then we have to take the smallest such solution to obtain the  τ {\displaystyle \tau } th quantile of the random variable Y.

#### Example

[edit]

Let  Y {\displaystyle Y} be a discrete random variable that takes values  y i = i {\displaystyle y_{i}=i} with  i = 1 , 2 , … , 9 {\displaystyle i=1,2,\dots ,9} with equal probabilities. The task is to find the median of Y, and hence the value  τ = 0.5 {\displaystyle \tau =0.5} is chosen. Then the expected loss of  Y − u {\displaystyle Y-u} is

L ( u ) = E ( ρ τ ( Y − u ) ) = ( τ − 1 ) 9 ∑ y i < u ( y i − u ) + τ 9 ∑ y i ≥ u ( y i − u ) = 0.5 9 ( − ∑ y i < u ( y i − u ) + ∑ y i ≥ u ( y i − u ) ) . {\displaystyle {\begin{array}{lll}L(u)&=&E(\rho _{\tau }(Y-u))={\frac {(\tau -1)}{9}}\sum _{y_{i}<u}(y_{i}-u)+{\frac {\tau }{9}}\sum _{y_{i}\geq u}(y_{i}-u)\\\&=&{\frac {0.5}{9}}{\Bigl (}-\sum _{y_{i}<u}(y_{i}-u)+\sum _{y_{i}\geq u}(y_{i}-u){\Bigr )}.\end{array}}}

Since  0.5 / 9 {\displaystyle {0.5/9}} is a constant, it can be taken out of the expected loss function (this is only true if  τ = 0.5 {\displaystyle \tau =0.5} ). Then, at u=3,

L ( 3 ) ∝ ∑ i = 1 2 {\displaystyle L(3)\propto \sum _{i=1}^{2}} − ( i − 3 ) {\displaystyle -(i-3)} + ∑ i = 3 9 {\displaystyle +\sum _{i=3}^{9}} ( i − 3 ) {\displaystyle (i-3)} = [ ( 2 + 1 ) + ( 0 + 1 + 2 + . . . + 6 ) ] = 24. {\displaystyle =[(2+1)+(0+1+2+...+6)]=24.}

Suppose that u is increased by 1 unit. Then the expected loss will be changed by  ( 3 ) − ( 6 ) = − 3 {\displaystyle (3)-(6)=-3} on changing u to 4. If, u=5, the expected loss is

L ( 5 ) ∝ ∑ i = 1 4 i + ∑ i = 0 4 i = 20 , {\displaystyle L(5)\propto \sum _{i=1}^{4}i+\sum _{i=0}^{4}i=20,}

and any change in u will increase the expected loss. Thus u=5 is the median. The Table below shows the expected loss (divided by  0.5 / 9 {\displaystyle {0.5/9}} ) for different values of u.

u | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

|
|
|
|
|
|
|
|
|

Expected loss | 36 | 29 | 24 | 21 | 20 | 21 | 24 | 29 | 36

#### Intuition

[edit]

Consider  τ = 0.5 {\displaystyle \tau =0.5} and let q be an initial guess for  q τ {\displaystyle q_{\tau }} . The expected loss evaluated at q is

L ( q ) = − 0.5 ∫ − ∞ q ( y − q ) d F Y ( y ) + 0.5 ∫ q ∞ ( y − q ) d F Y ( y ) . {\displaystyle L(q)=-0.5\int _{-\infty }^{q}(y-q)dF_{Y}(y)+0.5\int _{q}^{\infty }(y-q)dF_{Y}(y).}

In order to minimize the expected loss, we move the value of q a little bit to see whether the expected loss will rise or fall. Suppose we increase q by 1 unit. Then the change of expected loss would be

∫ − ∞ q 1 d F Y ( y ) − ∫ q ∞ 1 d F Y ( y ) . {\displaystyle \int _{-\infty }^{q}1dF_{Y}(y)-\int _{q}^{\infty }1dF_{Y}(y).}

The first term of the equation is  F Y ( q ) {\displaystyle F_{Y}(q)} and second term of the equation is  1 − F Y ( q ) {\displaystyle 1-F_{Y}(q)} . Therefore, the change of expected loss function is negative if and only if  F Y ( q ) < 0.5 {\displaystyle F_{Y}(q)<0.5} , that is if and only if q is smaller than the median. Similarly, if we reduce q by 1 unit, the change of expected loss function is negative if and only if q is larger than the median.

In order to minimize the expected loss function, we would increase (decrease) q if q is smaller (larger) than the median, until q reaches the median. The idea behind the minimization is to count the number of points (weighted with the density) that are larger or smaller than q and then move q to a point where q is larger than  100 τ {\displaystyle 100\tau } % of the points.

### Sample quantile

[edit]

The  τ {\displaystyle \tau } sample quantile can be obtained by using an importance sampling estimate and solving the following minimization problem

q ^ τ = arg min q ∈ R ∑ i = 1 n ρ τ ( y i − q ) , {\displaystyle {\hat {q}}_{\tau }={\underset {q\in \mathbb {R} }{\mbox{arg min}}}\sum _{i=1}^{n}\rho _{\tau }(y_{i}-q),}
= arg min q ∈ R [ ( τ − 1 ) ∑ y i < q ( y i − q ) + τ ∑ y i ≥ q ( y i − q ) ] {\displaystyle ={\underset {q\in \mathbb {R} }{\mbox{arg min}}}\left[(\tau -1)\sum _{y_{i}<q}(y_{i}-q)+\tau \sum _{y_{i}\geq q}(y_{i}-q)\right]} ,

where the function  ρ τ {\displaystyle \rho _{\tau }} is the tilted absolute value function. The intuition is the same as for the population quantile.

## Conditional quantile and quantile regression

[edit]

The  τ {\displaystyle \tau } th conditional quantile of  Y {\displaystyle Y} given  X {\displaystyle X} is the  τ {\displaystyle \tau } th quantile of the Conditional probability distribution of  Y {\displaystyle Y} given  X {\displaystyle X} ,

Q Y | X ( τ ) = inf { y : F Y | X ( y ) ≥ τ } {\displaystyle Q_{Y|X}(\tau )=\inf \left\\{y:F_{Y|X}(y)\geq \tau \right\\}} .

We use a capital  Q {\displaystyle Q} to denote the conditional quantile to indicate that it is a random variable.

In quantile regression for the  τ {\displaystyle \tau } th quantile we make the assumption that the  τ {\displaystyle \tau } th conditional quantile is given as a linear function of the explanatory variables:

Q Y | X ( τ ) = X β τ {\displaystyle Q_{Y|X}(\tau )=X\beta _{\tau }} .

Given the distribution function of  Y {\displaystyle Y} ,  β τ {\displaystyle \beta _{\tau }} can be obtained by solving

β τ = arg min β ∈ R k E ( ρ τ ( Y − X β ) ) . {\displaystyle \beta _{\tau }={\underset {\beta \in \mathbb {R} ^{k}}{\mbox{arg min}}}E(\rho _{\tau }(Y-X\beta )).}

Solving the sample analog gives the estimator of  β {\displaystyle \beta } .

β τ ^ = arg min β ∈ R k ∑ i = 1 n ( ρ τ ( Y i − X i β ) ) . {\displaystyle {\hat {\beta _{\tau }}}={\underset {\beta \in \mathbb {R} ^{k}}{\mbox{arg min}}}\sum _{i=1}^{n}(\rho _{\tau }(Y_{i}-X_{i}\beta )).}

Note that when  τ = 0.5 {\displaystyle \tau =0.5} , the loss function  ρ τ {\displaystyle \rho _{\tau }} is proportional to the absolute value function, and thus median regression is the same as linear regression by least absolute deviations.

## Computation of estimates for regression parameters

[edit]

The mathematical forms arising from quantile regression are distinct from those arising in the method of least squares. The method of least squares leads to a consideration of problems in an inner product space, involving projection onto subspaces, and thus the problem of minimizing the squared errors can be reduced to a problem in numerical linear algebra. Quantile regression does not have this structure, and instead the minimization problem can be reformulated as a linear programming problem

min β , u + , u − ∈ R k × R + 2 n { τ 1 n ′ u + + ( 1 − τ ) 1 n ′ u − | X β + u + − u − = Y } , {\displaystyle {\underset {\beta ,u^{+},u^{-}\in \mathbb {R} ^{k}\times \mathbb {R} _{+}^{2n}}{\min }}\left\\{\tau 1_{n}^{'}u^{+}+(1-\tau )1_{n}^{'}u^{-}|X\beta +u^{+}-u^{-}=Y\right\\},}

where

u j + = max ( u j , 0 ) {\displaystyle u_{j}^{+}=\max(u_{j},0)} ,    u j − = − min ( u j , 0 ) . {\displaystyle u_{j}^{-}=-\min(u_{j},0).}

Simplex methods[2]: 181  or interior point methods[2]: 190  can be applied to solve the linear programming problem.

## Asymptotic properties

[edit]

For  τ ∈ ( 0 , 1 ) {\displaystyle \tau \in (0,1)} , under some regularity conditions,  β ^ τ {\displaystyle {\hat {\beta }}_{\tau }} is asymptotically normal:

n ( β ^ τ − β τ ) → d N ( 0 , τ ( 1 − τ ) D − 1 Ω x D − 1 ) , {\displaystyle {\sqrt {n}}({\hat {\beta }}_{\tau }-\beta _{\tau }){\overset {d}{\rightarrow }}N(0,\tau (1-\tau )D^{-1}\Omega _{x}D^{-1}),}

where

D = E ( f Y ( X β ) X X ′ ) {\displaystyle D=E(f_{Y}(X\beta )XX^{\prime })} and  Ω x = E ( X ′ X ) . {\displaystyle \Omega _{x}=E(X^{\prime }X).}

Direct estimation of the asymptotic variance-covariance matrix is not always satisfactory. Inference for quantile regression parameters can be made with the regression rank-score tests or with the bootstrap methods.[10]

## Equivariance

[edit]

See invariant estimator for background on invariance or see equivariance.

### Scale equivariance

[edit]

For any  a > 0 {\displaystyle a>0} and  τ ∈ [ 0 , 1 ] {\displaystyle \tau \in [0,1]}

β ^ ( τ ; a Y , X ) = a β ^ ( τ ; Y , X ) , {\displaystyle {\hat {\beta }}(\tau ;aY,X)=a{\hat {\beta }}(\tau ;Y,X),}
β ^ ( τ ; − a Y , X ) = − a β ^ ( 1 − τ ; Y , X ) . {\displaystyle {\hat {\beta }}(\tau ;-aY,X)=-a{\hat {\beta }}(1-\tau ;Y,X).}

### Shift equivariance

[edit]

For any  γ ∈ R k {\displaystyle \gamma \in R^{k}} and  τ ∈ [ 0 , 1 ] {\displaystyle \tau \in [0,1]}

β ^ ( τ ; Y + X γ , X ) = β ^ ( τ ; Y , X ) + γ . {\displaystyle {\hat {\beta }}(\tau ;Y+X\gamma ,X)={\hat {\beta }}(\tau ;Y,X)+\gamma .}

### Equivariance to reparameterization of design

[edit]

Let  A {\displaystyle A} be any  p × p {\displaystyle p\times p} nonsingular matrix and  τ ∈ [ 0 , 1 ] {\displaystyle \tau \in [0,1]}

β ^ ( τ ; Y , X A ) = A − 1 β ^ ( τ ; Y , X ) . {\displaystyle {\hat {\beta }}(\tau ;Y,XA)=A^{-1}{\hat {\beta }}(\tau ;Y,X).}

### Invariance to monotone transformations

[edit]

If  h {\displaystyle h} is a nondecreasing function on  R {\displaystyle \mathbb {R} } , the following invariance property applies:

h ( Q Y | X ( τ ) ) ≡ Q h ( Y ) | X ( τ ) . {\displaystyle h(Q_{Y|X}(\tau ))\equiv Q_{h(Y)|X}(\tau ).}

Example (1):

If  W = exp ⁡ ( Y ) {\displaystyle W=\exp(Y)} and  Q Y | X ( τ ) = X β τ {\displaystyle Q_{Y|X}(\tau )=X\beta _{\tau }} , then  Q W | X ( τ ) = exp ⁡ ( X β τ ) {\displaystyle Q_{W|X}(\tau )=\exp(X\beta _{\tau })} . The mean regression does not have the same property since  E ⁡ ( ln ⁡ ( Y ) ) ≠ ln ⁡ ( E ⁡ ( Y ) ) . {\displaystyle \operatorname {E} (\ln(Y))\neq \ln(\operatorname {E} (Y)).}

## Inference

[edit]

### Interpretation of the slope parameters

[edit]

The linear model  Q Y | X ( τ ) = X β τ {\displaystyle Q_{Y|X}(\tau )=X\beta _{\tau }} mis-specifies the true systematic relation  Q Y | X ( τ ) = f ( X , τ ) {\displaystyle Q_{Y|X}(\tau )=f(X,\tau )} when  f ( ⋅ , τ ) {\displaystyle f(\cdot ,\tau )} is nonlinear. However,  Q Y | X ( τ ) = X β τ {\displaystyle Q_{Y|X}(\tau )=X\beta _{\tau }} minimizes a weighted distanced to  f ( X , τ ) {\displaystyle f(X,\tau )} among linear models.[11] Furthermore, the slope parameters  β τ {\displaystyle \beta _{\tau }} of the linear model can be interpreted as weighted averages of the derivatives  ∇ f ( X , τ ) {\displaystyle \nabla f(X,\tau )} so that  β τ {\displaystyle \beta _{\tau }} can be used for causal inference.[12] Specifically, the hypothesis  H 0 : ∇ f ( x , τ ) = 0 {\displaystyle H_{0}:\nabla f(x,\tau )=0} for all  x {\displaystyle x} implies the hypothesis  H 0 : β τ = 0 {\displaystyle H_{0}:\beta _{\tau }=0} , which can be tested using the estimator  β τ ^ {\displaystyle {\hat {\beta _{\tau }}}} and its limit distribution.

### Goodness of fit

[edit]

The goodness of fit for quantile regression for the  τ {\displaystyle \tau } quantile can be defined as:[13] R 1 ( τ ) = 1 − V ^ τ V ~ τ , {\displaystyle R^{1}(\tau )=1-{\frac {{\hat {V}}_{\tau }}{{\tilde {V}}_{\tau }}},} where  V ^ τ {\displaystyle {\hat {V}}_{\tau }} is the minimized expected loss function under the full model, while  V ~ τ {\displaystyle {\tilde {V}}_{\tau }} is the expected loss function under the intercept-only model.

## Variants

[edit]

### Bayesian methods for quantile regression

[edit]

Because quantile regression does not normally assume a parametric likelihood for the conditional distributions of Y|X, the Bayesian methods work with a working likelihood. A convenient choice is the asymmetric Laplacian likelihood,[14] because the mode of the resulting posterior under a flat prior is the usual quantile regression estimates. The posterior inference, however, must be interpreted with care. Yang, Wang and He[15] provided a posterior variance adjustment for valid inference. In addition, Yang and He[16] showed that one can have asymptotically valid posterior inference if the working likelihood is chosen to be the empirical likelihood.

### Machine learning methods for quantile regression

[edit]

Beyond simple linear regression, there are several machine learning methods that can be extended to quantile regression. A switch from the squared error to the tilted absolute value loss function (a.k.a. the pinball loss[17]) allows gradient descent-based learning algorithms to learn a specified quantile instead of the mean. It means that we can apply all neural network and deep learning algorithms to quantile regression,[18][19] which is then referred to as nonparametric quantile regression.[20] Tree-based learning algorithms are also available for quantile regression (see, e.g., Quantile Regression Forests,[21] as a simple generalization of Random Forests).

### Censored quantile regression

[edit]

If the response variable is subject to censoring, the conditional mean is not identifiable without additional distributional assumptions, but the conditional quantile is often identifiable. For recent work on censored quantile regression, see: Portnoy[22] and Wang and Wang[23]

Example (2):

Let  Y c = max ( 0 , Y ) {\displaystyle Y^{c}=\max(0,Y)} and  Q Y | X = X β τ {\displaystyle Q_{Y|X}=X\beta _{\tau }} . Then  Q Y c | X ( τ ) = max ( 0 , X β τ ) {\displaystyle Q_{Y^{c}|X}(\tau )=\max(0,X\beta _{\tau })} . This is the censored quantile regression model: estimated values can be obtained without making any distributional assumptions, but at the cost of computational difficulty,[24] some of which can be avoided by using a simple three step censored quantile regression procedure as an approximation.[25]

For random censoring on the response variables, the censored quantile regression of Portnoy (2003)[22] provides consistent estimates of all identifiable quantile functions based on reweighting each censored point appropriately.

Censored quantile regression has close links to survival analysis.

Depiction of two Kaplan–Meier estimators for the survival probabilities  S ( t ) = 1 − F ( t ) {\displaystyle S(t)=1-F(t)} of two patient groups as a function of time  t {\displaystyle t} , where  F ( t ) {\displaystyle F(t)} is the distribution function of the deaths. The  τ {\displaystyle \tau } quantile of the deaths is  t τ = F − 1 ( τ ) {\displaystyle t_{\tau }=F^{-1}(\tau )} , where  F − 1 {\displaystyle F^{-1}} is the quantile function of the deaths. Censored quantile regression can be used to estimate these conditional quantiles individually, while survival analysis estimates the (conditional) survival function.

### Heteroscedastic errors

[edit]

The quantile regression loss needs to be adapted in the presence of heteroscedastic errors in order to be efficient.[26]

## Implementations

[edit]

Numerous statistical software packages include implementations of quantile regression:

* Matlab function `quantreg`[27]
* gretl has the `quantreg` command.[28]
* R offers several packages that implement quantile regression, most notably `quantreg` by Roger Koenker,[29] but also `gbm`,[30] `quantregForest`,[31] `qrnn`[32] and `qgam`[33]
* Python, via `Scikit-garden`[34] and `statsmodels`[35]
* SAS through `proc quantreg` (ver. 9.2)[36] and `proc quantselect` (ver. 9.3).[37]
* Stata, via the `qreg` command.[38][39]
* Vowpal Wabbit, via `--loss_function quantile`.[40]
* Mathematica package `QuantileRegression.m`[41] hosted at the MathematicaForPrediction project at GitHub.
* Wolfram Language function `QuantileRegression`[42] hosted at Wolfram Function Repository.

## See also

[edit]

* Least-absolute-deviations regression
* Conformal prediction

## Literature

[edit]

The Wikibook R Programming has a page on the topic of: Quantile Regression

* Angrist, Joshua D.; Pischke, Jörn-Steffen (2009). "Quantile Regression". Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press. pp. 269–291\. ISBN 978-0-691-12034-8.
* Koenker, Roger (2005). Quantile Regression. Cambridge University Press. ISBN 978-0-521-60827-5.

## References

[edit]

1. ^ Tofallis (2015). "A Better Measure of Relative Prediction Accuracy for Model Selection and Model Estimation", Journal of the Operational Research Society, 66(8):1352-1362. [1]
2. ^ a b c d e Koenker, Roger (2005). Quantile Regression. Cambridge University Press. pp. 146–7. ISBN 978-0-521-60827-5.
3. ^ Cade, Brian S.; Noon, Barry R. (2003). "A gentle introduction to quantile regression for ecologists" (PDF). Frontiers in Ecology and the Environment. 1 (8): 412–420\. doi:10.2307/3868138. JSTOR 3868138.
4. ^ Wei, Y.; Pere, A.; Koenker, R.; He, X. (2006). "Quantile Regression Methods for Reference Growth Charts". Statistics in Medicine. 25 (8): 1369–1382\. doi:10.1002/sim.2271. PMID 16143984. S2CID 7830193.
5. ^ Wei, Y.; He, X. (2006). "Conditional Growth Charts (with discussions)". Annals of Statistics. 34 (5): 2069–2097 and 2126–2131. arXiv:math/0702634. doi:10.1214/009053606000000623. S2CID 88516697.
6. ^ Stigler, S. (1984). "Boscovich, Simpson and a 1760 manuscript note on fitting a linear relation". Biometrika. 71 (3): 615–620\. doi:10.1093/biomet/71.3.615.
7. ^ Koenker, Roger (2005). Quantile Regression. Cambridge: Cambridge University Press. pp. 2. ISBN 9780521845731.
8. ^ a b Furno, Marilena; Vistocco, Domenico (2018). Quantile Regression: Estimation and Simulation. Hoboken, NJ: John Wiley & Sons. pp. xv. ISBN 9781119975281.
9. ^ Koenker, Roger (August 1998). "Galton, Edgeworth, Frisch, and prospects for quantile regression in economics" (PDF). UIUC.edu. Retrieved August 22, 2018.
10. ^ Kocherginsky, M.; He, X.; Mu, Y. (2005). "Practical Confidence Intervals for Regression Quantiles". Journal of Computational and Graphical Statistics. 14 (1): 41–55\. doi:10.1198/106186005X27563. S2CID 120598656.
11. ^ Angrist, J.; Chernozhukov, V.; Fernandez-Val, I. (2006). "Quantile Regression under Misspecification, with an Application to the U.S. Wage Structure" (PDF). Econometrica. 74 (2): 539–563\. doi:10.1111/j.1468-0262.2006.00671.x.
12. ^ Kato, R.; Sasaki, Y. (2017). "On Using Linear Quantile Regressions for Causal Inference". Econometric Theory. 33 (3): 664–690\. doi:10.1017/S0266466616000177.
13. ^ Roger Koenker & José A. F. Machado (1999) Goodness of Fit and Related Inference Processes for Quantile Regression, Journal of the American Statistical Association, 94:448, 1296-1310, DOI: 10.1080/01621459.1999.10473882
14. ^ Kozumi, H.; Kobayashi, G. (2011). "Gibbs sampling methods for Bayesian quantile regression" (PDF). Journal of Statistical Computation and Simulation. 81 (11): 1565–1578\. doi:10.1080/00949655.2010.496117. S2CID 44015988.
15. ^ Yang, Y.; Wang, H.X.; He, X. (2016). "Posterior Inference in Bayesian Quantile Regression with Asymmetric Laplace Likelihood". International Statistical Review. 84 (3): 327–344\. doi:10.1111/insr.12114. hdl:2027.42/135059. S2CID 14947362.
16. ^ Yang, Y.; He, X. (2010). "Bayesian empirical likelihood for quantile regression". Annals of Statistics. 40 (2): 1102–1131\. arXiv:1207.5378. doi:10.1214/12-AOS1005. S2CID 88519086.
17. ^ Steinwart, Ingo; Christmann, Andreas (2011). "Estimating conditional quantiles with the help of the pinball loss". Bernoulli. 17 (1). Bernoulli Society for Mathematical Statistics and Probability: 211–225\. arXiv:1102.2101. doi:10.3150/10-BEJ267.
18. ^ Petneházi, Gábor (2019-08-21). "QCNN: Quantile Convolutional Neural Network". arXiv:1908.07978 [cs.LG].
19. ^ Rodrigues, Filipe; Pereira, Francisco C. (2018-08-27). "Beyond expectation: Deep joint mean and quantile regression for spatio-temporal problems". arXiv:1808.08798 [stat].
20. ^ Nonparametric Quantile Regression: Non-Crossing Constraints and Conformal Prediction by Wenlu Tang, Guohao Shen, Yuanyuan Lin, Jian Huang, https://arxiv.org/pdf/2210.10161.pdf
21. ^ Meinshausen, Nicolai (2006). "Quantile Regression Forests" (PDF). Journal of Machine Learning Research. 7 (6): 983–999.
22. ^ a b Portnoy, S. L. (2003). "Censored Regression Quantiles". Journal of the American Statistical Association. 98 (464): 1001–1012\. doi:10.1198/016214503000000954. S2CID 120674851.
23. ^ Wang, H.; Wang, L. (2009). "Locally Weighted Censored Quantile Regression". Journal of the American Statistical Association. 104 (487): 1117–1128\. CiteSeerX 10.1.1.504.796. doi:10.1198/jasa.2009.tm08230. S2CID 34494316.
24. ^ Powell, James L. (1986). "Censored Regression Quantiles". Journal of Econometrics. 32 (1): 143–155\. doi:10.1016/0304-4076(86)90016-3.
25. ^ Chernozhukov, Victor; Hong, Han (2002). "Three-Step Censored Quantile Regression and Extramarital Affairs". J. Amer. Statist. Assoc. 97 (459): 872–882\. doi:10.1198/016214502388618663. S2CID 1410755.
26. ^ Efficient Quantile Regression for Heteroscedastic Models by, Yoonsuh Jung, Yoonkyung Lee, Steven N. MacEachern, https://www.tandfonline.com/doi/abs/10.1080/00949655.2014.967244?journalCode=gscs20
27. ^ "quantreg(x,y,tau,order,Nboot) - File Exchange - MATLAB Central". www.mathworks.com. Retrieved 2016-02-01.
28. ^ "Gretl Command Reference" (PDF). April 2017. Archived from the original (PDF) on 2018-12-15. Retrieved 2017-04-22.
29. ^ "quantreg: Quantile Regression". R Project. 2018-12-18.
30. ^ "gbm: Generalized Boosted Regression Models". R Project. 2019-01-14.
31. ^ "quantregForest: Quantile Regression Forests". R Project. 2017-12-19.
32. ^ "qrnn: Quantile Regression Neural Networks". R Project. 2018-06-26.
33. ^ "qgam: Smooth Additive Quantile Regression Models". R Project. 2019-05-23.
34. ^ "Quantile Regression Forests". Scikit-garden. Retrieved 3 January 2019.
35. ^ "Statsmodels: Quantile Regression". Statsmodels. Retrieved 15 November 2019.
36. ^ "An Introduction to Quantile Regression and the QUANTREG Procedure" (PDF). SAS Support.
37. ^ "The QUANTSELECT Procedure". SAS Support. Archived from the original on 2022-01-12. Retrieved 2022-01-12.
38. ^ "qreg — Quantile regression" (PDF). Stata Manual.
39. ^ Cameron, A. Colin; Trivedi, Pravin K. (2010). "Quantile Regression". Microeconometrics Using Stata (Revised ed.). College Station: Stata Press. pp. 211–234\. ISBN 978-1-59718-073-3.
40. ^ "JohnLangford/vowpal_wabbit". GitHub. Retrieved 2016-07-09.
41. ^ "QuantileRegression.m". MathematicaForPrediction. Retrieved 3 January 2019.
42. ^ "QuantileRegression". Wolfram Function Repository. Retrieved 14 September 2022.

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template