Jump to content

Quantile regression

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Aaron McDaid (talk | contribs) at 20:36, 27 June 2013 (Quantiles: The |absolute value| symbol was missing from the loss function definition). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Quantile regression is a type of regression analysis used in statistics and econometrics. Whereas the method of least squares results in estimates that approximate the conditional mean of the response variable given certain values of the predictor variables, quantile regression aims at estimating either the conditional median or other quantiles of the response variable.

Advantages and applications

Quantile regression is desired if conditional quantile functions are of interest. One advantage of quantile regression, relative to the 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 that. In practice we often prefer using different measures of central tendency and statistical dispersion to obtain a more comprehensive analysis of the relationship between variables .[1]

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.[2]

Another application of quantile regression is in the areas of growth charts, where percentile curves are commonly used to screen for abnormal growth; see Wei et al. (2005) and Wei and He (2006).

Mathematics

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 leads to problems in linear programming that can be solved by the simplex method. The fact that the algorithms of linear programming appear more esoteric to some users may explain partially why quantile regression has not been as widely used as the method of least squares.[3]

History

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.,.[4][5] Median regression computations for larger data sets are quite tedious compared to the least squares method, which historically generated a lack of popularity among statisticians, until the widespread use of computers in the latter part of the 20th century.

Quantiles

Let be a real valued random variable with cumulative distribution function . The th quantile of Y is given by

where

Define the loss function as , where is an indicator variable. A specific quantile can be found by minimizing the expected loss of with respect to :[6]

This can be shown by setting the derivative of the expected loss function to 0 and letting be the solution of

This equation reduces to

and then to

Hence is th quantile of the random variable Y.

Example

Let be a discrete random variable that takes values 1,2,..,9 with equal probabilities. The task is to find the median of Y, and hence the value is chosen. The expected loss, L(u), is

Since is a constant, it can be taken out of the expected loss function (this is only true if ). Then, at u=3,

Suppose that u is increased by 1 unit. Then the expected loss will be changed by on changing u to 4. If , u=5, the expected loss is

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 ) 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

Consider and let q be an initial guess for . The expected loss evaluated at q is

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

The first term of the equation is and second term of the equation is . Therefore the change of expected loss function is negative if and only if , 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) L(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 % of the points.

Sample quantile

The sample quantile can be obtained by solving the following minimization problem

The intuition is the same as for the population quantile.

Conditional Quantile and Quantile Regression

Suppose the th conditional quantile function is . Given the distribution function of , can be obtained by solving

Solving the sample analog gives the estimator of .

Computation

The minimization problem can be reformulated as a linear programming problem

where

,    ,     ,   

Simplex methods[7] or interior point methods[8] can be applied to solve the linear programming problem.

Asymptotic properties

For , under some regularity conditions, is asymptotically normal:

where

and

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; see Kocherginsky, He, and Mu (2005).

Equivariance

See invariant estimator for background on invariance or see equivariance.

Scale equivariance

For any and

Shift equivariance

For any and

Equivariance to reparameterization of design

Let be any nonsingular matrix and

Invariance to monotone transformations

If is a nondecreasing function on 'R, the following invariance property applies:

Example (1):

Let and , then . The mean regression does not have the same property since

Censored Quantile Regression

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.[9]

Example (2):

Let and , then . This is the censored quantile regression model: estimated values can be obtained without making any distributional assumptions, but at the cost of computational difficulty,[10] some of which can be avoided by using a simple three step censored quantile regression procedure as an approximation.[11]

Implementations

Statistical software packages, such as R, Eviews (ver. 6), Stata (via qreg), gretl, SAS through proc quantreg (ver. 9.2), and RATS include implementations of quantile regression. Several R packages implement quantile regression using different methods: quantreg package by Roger Koenker, gbm, and quantregForest.

Notes

  1. ^ Koenker (2005) [page needed]
  2. ^ Brian S. Cade, Barry R. Noon, (2003) "A gentle introduction to quantile regression for ecologists", Frontiers in Ecology and the Environment, 1 (8), 412–420.
  3. ^ Roger Koenker, Kevin F. Hallock, (2001) "Quantile Regression", Journal of Economic Perspectives, 15 (4), 143–156
  4. ^ Stigler, S. (1984): Boscovich, Simpson and a 1760 manuscript note on fitting a linear relation,"Biometrika, 71, 615{620}
  5. ^ Roger Koenker. Quantile Regression. Cambridge University Press, 2005, page 4
  6. ^ Koenker (2005) p.5-p.6
  7. ^ Koenker (2005) p.181
  8. ^ Koenker (2005) p.190
  9. ^ For recent work on censored quantile regression, see Portnoy (2003) and Wang and Wang (2009).
  10. ^ James L. Powell (1986) “Censored regression quantiles,” Journal of Econometrics, 32 (1), 143–155.
  11. ^ Victor Chernozhukov and Han Hong, “Three-Step Censored Quantile Regression and Extramarital Affairs,” Journal of the American Statistical Association, 97 (9), no. 459, 872–882.

References

  • Koenker, Roger (2005) Quantile Regression, Cambridge University Press. ISBN 0-521-60827-9
  • Kocherginsky, M., He, X. and Mu, Y. (2005) ``Practical Confidence Intervals for Regression Quantiles", Journal of Computational and Graphical Statistics, Vol. 14, no. 1, 41-55.
  • Portnoy, S.L. (2003) ``Censored quantile regression" , Journal of the American Statistical Association, Vol. 98, no. 464, 1001-1012.
  • Wang, H. and Wang, L. (2009) ``Locally Weighted Censored Quantile Regression", Journal of the American Statistical Association, Vol. 104, no. 487, 1117-1128.
  • Wei, Y and He, X. (2006) ``Conditional Growth Charts (with discussions)", Annals of Statistics , Vol. 34, 2069–2097 and 2126-2131.
  • Wei, Y., Pere, A., Koenker, R. and He, X. (2006) ``Quantile Regression Methods for Reference Growth Curves", Statistics in Medicine , Vol. 25, no. 8, 1369-1382.