Quantile regression

Last updated

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. Quantile regression is an extension of linear regression used when the conditions of linear regression are not met.

Contents

Example for quantile regression Quantilsregression.svg
Example for quantile regression

Advantages and applications

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. [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. [3] [4]

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. [1] :4 [5] 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. [6] 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. [7]

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 [8] - a geometric approach to median regression - and is recognized as the precursor of the simplex method. [7] 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

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

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 function. A specific quantile can be found by minimizing the expected loss of with respect to : [1] (pp. 56):

This can be shown by computing the derivative of the expected loss with respect to via an application of the Leibniz integral rule, setting it to 0, and letting be the solution of

This equation reduces to

and then to

If the solution is not unique, then we have to take the smallest such solution to obtain the th quantile of the random variable Y.

Example

Let be a discrete random variable that takes values with with equal probabilities. The task is to find the median of Y, and hence the value is chosen. Then the expected loss of 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.

u123456789
Expected loss362924212021242936

Intuition

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

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

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 using an importance sampling estimate and solving the following minimization problem

,

where the function is the tilted absolute value function. The intuition is the same as for the population quantile.

Conditional quantile and quantile regression

The th conditional quantile of given is the th quantile of the Conditional probability distribution of given ,

.

We use a capital to denote the conditional quantile to indicate that it is a random variable.

In quantile regression for the th quantile we make the assumption that the th conditional quantile is given as a linear function of the explanatory variables:

.

Given the distribution function of , can be obtained by solving

Solving the sample analog gives the estimator of .

Note that when , the loss function 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

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

where

,   

Simplex methods [1] :181 or interior point methods [1] :190 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. [9]

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 , the following invariance property applies:

Example (1):

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

Inference

Interpretation of the slope parameters

The linear model mis-specifies the true systematic relation when is nonlinear. However, minimizes a weighted distanced to among linear models. [10] Furthermore, the slope parameters of the linear model can be interpreted as weighted averages of the derivatives so that can be used for causal inference. [11] Specifically, the hypothesis for all implies the hypothesis , which can be tested using the estimator and its limit distribution.

Goodness of fit

The goodness of fit for quantile regression for the quantile can be defined as: [12] where is the sum of squares of the conditional quantile, while is the sum of squares of the unconditional quantile.

Variants

Bayesian methods for quantile regression

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, [13] 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 [14] provided a posterior variance adjustment for valid inference. In addition, Yang and He [15] 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

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 [16] ) 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, [17] [18] which is then referred to as nonparametric quantile regression. [19] Tree-based learning algorithms are also available for quantile regression (see, e.g., Quantile Regression Forests, [20] as a simple generalization of Random Forests).

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. For recent work on censored quantile regression, see: Portnoy [21] and Wang and Wang [22]

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, [23] some of which can be avoided by using a simple three step censored quantile regression procedure as an approximation. [24]

For random censoring on the response variables, the censored quantile regression of Portnoy (2003) [21] 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
t
{\displaystyle \tau }
quantile of the deaths is
t
t
=
F
-
1
(
t
)
{\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. Km plot.jpg
Depiction of two Kaplan–Meier estimators for the survival probabilities of two patient groups as a function of time , where is the distribution function of the deaths. The quantile of the deaths is , where 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

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

Implementations

Numerous statistical software packages include implementations of quantile regression:

See also

Literature

Related Research Articles

<span class="mw-page-title-main">Gumbel distribution</span> Particular case of the generalized extreme value distribution

In probability theory and statistics, the Gumbel distribution is used to model the distribution of the maximum of a number of samples of various distributions.

<span class="mw-page-title-main">Logistic distribution</span> Continuous probability distribution

In probability theory and statistics, the logistic distribution is a continuous probability distribution. Its cumulative distribution function is the logistic function, which appears in logistic regression and feedforward neural networks. It resembles the normal distribution in shape but has heavier tails. The logistic distribution is a special case of the Tukey lambda distribution.

In statistics, a generalized linear model (GLM) is a flexible generalization of ordinary linear regression. The GLM generalizes linear regression by allowing the linear model to be related to the response variable via a link function and by allowing the magnitude of the variance of each measurement to be a function of its predicted value.

<span class="mw-page-title-main">Regression analysis</span> Set of statistical processes for estimating the relationships among variables

In statistical modeling, regression analysis is a set of statistical processes for estimating the relationships between a dependent variable and one or more independent variables. The most common form of regression analysis is linear regression, in which one finds the line that most closely fits the data according to a specific mathematical criterion. For example, the method of ordinary least squares computes the unique line that minimizes the sum of squared differences between the true data and that line. For specific mathematical reasons, this allows the researcher to estimate the conditional expectation of the dependent variable when the independent variables take on a given set of values. Less common forms of regression use slightly different procedures to estimate alternative location parameters or estimate the conditional expectation across a broader collection of non-linear models.

Stochastic gradient descent is an iterative method for optimizing an objective function with suitable smoothness properties. It can be regarded as a stochastic approximation of gradient descent optimization, since it replaces the actual gradient by an estimate thereof. Especially in high-dimensional optimization problems this reduces the very high computational burden, achieving faster iterations in exchange for a lower convergence rate.

In statistics, ordinary least squares (OLS) is a type of linear least squares method for choosing the unknown parameters in a linear regression model by the principle of least squares: minimizing the sum of the squares of the differences between the observed dependent variable in the input dataset and the output of the (linear) function of the independent variable.

In statistics, the Breusch–Pagan test, developed in 1979 by Trevor Breusch and Adrian Pagan, is used to test for heteroskedasticity in a linear regression model. It was independently suggested with some extension by R. Dennis Cook and Sanford Weisberg in 1983. Derived from the Lagrange multiplier test principle, it tests whether the variance of the errors from a regression is dependent on the values of the independent variables. In that case, heteroskedasticity is present.

In statistics, M-estimators are a broad class of extremum estimators for which the objective function is a sample average. Both non-linear least squares and maximum likelihood estimation are special cases of M-estimators. The definition of M-estimators was motivated by robust statistics, which contributed new types of M-estimators. However, M-estimators are not inherently robust, as is clear from the fact that they include maximum likelihood estimators, which are in general not robust. The statistical procedure of evaluating an M-estimator on a data set is called M-estimation.

In statistics, binomial regression is a regression analysis technique in which the response has a binomial distribution: it is the number of successes in a series of independent Bernoulli trials, where each trial has probability of success . In binomial regression, the probability of a success is related to explanatory variables: the corresponding concept in ordinary regression is to relate the mean value of the unobserved response to explanatory variables.

The softmax function, also known as softargmax or normalized exponential function, converts a vector of K real numbers into a probability distribution of K possible outcomes. It is a generalization of the logistic function to multiple dimensions, and used in multinomial logistic regression. The softmax function is often used as the last activation function of a neural network to normalize the output of a network to a probability distribution over predicted output classes, based on Luce's choice axiom.

Non-linear least squares is the form of least squares analysis used to fit a set of m observations with a model that is non-linear in n unknown parameters (m ≥ n). It is used in some forms of nonlinear regression. The basis of the method is to approximate the model by a linear one and to refine the parameters by successive iterations. There are many similarities to linear least squares, but also some significant differences. In economic theory, the non-linear least squares method is applied in (i) the probit regression, (ii) threshold regression, (iii) smooth regression, (iv) logistic link regression, (v) Box–Cox transformed regressors ().

Least absolute deviations (LAD), also known as least absolute errors (LAE), least absolute residuals (LAR), or least absolute values (LAV), is a statistical optimality criterion and a statistical optimization technique based on minimizing the sum of absolute deviations or the L1 norm of such values. It is analogous to the least squares technique, except that it is based on absolute values instead of squared values. It attempts to find a function which closely approximates a set of data by minimizing residuals between points generated by the function and corresponding data points. The LAD estimate also arises as the maximum likelihood estimate if the errors have a Laplace distribution. It was introduced in 1757 by Roger Joseph Boscovich.

In statistics and machine learning, lasso is a regression analysis method that performs both variable selection and regularization in order to enhance the prediction accuracy and interpretability of the resulting statistical model. The lasso method assumes that the coefficients of the linear model are sparse, meaning that few of them are non-zero. It was originally introduced in geophysics, and later by Robert Tibshirani, who coined the term.

In statistics, projection pursuit regression (PPR) is a statistical model developed by Jerome H. Friedman and Werner Stuetzle that extends additive models. This model adapts the additive models in that it first projects the data matrix of explanatory variables in the optimal direction before applying smoothing functions to these explanatory variables.

The Generalized Additive Model for Location, Scale and Shape (GAMLSS) is an approach to statistical modelling and learning. GAMLSS is a modern distribution-based approach to (semiparametric) regression. A parametric distribution is assumed for the response (target) variable but the parameters of this distribution can vary according to explanatory variables using linear, nonlinear or smooth functions. In machine learning parlance, GAMLSS is a form of supervised machine learning.

Quantile Regression Averaging (QRA) is a forecast combination approach to the computation of prediction intervals. It involves applying quantile regression to the point forecasts of a small number of individual forecasting models or experts. It has been introduced in 2014 by Jakub Nowotarski and Rafał Weron and originally used for probabilistic forecasting of electricity prices and loads. Despite its simplicity it has been found to perform extremely well in practice - the top two performing teams in the price track of the Global Energy Forecasting Competition (GEFCom2014) used variants of QRA.

In statistics, linear regression is a statistical model which estimates the linear relationship between a scalar response and one or more explanatory variables. The case of one explanatory variable is called simple linear regression; for more than one, the process is called multiple linear regression. This term is distinct from multivariate linear regression, where multiple correlated dependent variables are predicted, rather than a single scalar variable. If the explanatory variables are measured with error then errors-in-variables models are required, also known as measurement error models.

In statistics, the class of vector generalized linear models (VGLMs) was proposed to enlarge the scope of models catered for by generalized linear models (GLMs). In particular, VGLMs allow for response variables outside the classical exponential family and for more than one parameter. Each parameter can be transformed by a link function. The VGLM framework is also large enough to naturally accommodate multiple responses; these are several independent responses each coming from a particular statistical distribution with possibly different parameter values.

A partially linear model is a form of semiparametric model, since it contains parametric and nonparametric elements. Application of the least squares estimators is available to partially linear model, if the hypothesis of the known of nonparametric element is valid. Partially linear equations were first used in the analysis of the relationship between temperature and usage of electricity by Engle, Granger, Rice and Weiss (1986). Typical application of partially linear model in the field of Microeconomics is presented by Tripathi in the case of profitability of firm's production in 1997. Also, partially linear model applied successfully in some other academic field. In 1994, Zeger and Diggle introduced partially linear model into biometrics. In environmental science, Parda-Sanchez et al. used partially linear model to analysis collected data in 2000. So far, partially linear model was optimized in many other statistic methods. In 1988, Robinson applied Nadaraya-Waston kernel estimator to test the nonparametric element to build a least-squares estimator After that, in 1997, local linear method was found by Truong.

Distributional data analysis is a branch of nonparametric statistics that is related to functional data analysis. It is concerned with random objects that are probability distributions, i.e., the statistical analysis of samples of random distributions where each atom of a sample is a distribution. One of the main challenges in distributional data analysis is that the space of probability distributions is, while a convex space, is not a vector space.

References

  1. 1 2 3 4 5 Koenker, Roger (2005). Quantile Regression . Cambridge University Press. pp.  146–7. ISBN   978-0-521-60827-5.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Koenker, Roger (2005). Quantile Regression . Cambridge: Cambridge University Press. pp.  2. ISBN   9780521845731.
  7. 1 2 Furno, Marilena; Vistocco, Domenico (2018). Quantile Regression: Estimation and Simulation. Hoboken, NJ: John Wiley & Sons. pp. xv. ISBN   9781119975281.
  8. Koenker, Roger (August 1998). "Galton, Edgeworth, Frisch, and prospects for quantile regression in economics" (PDF). UIUC.edu. Retrieved August 22, 2018.
  9. 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.
  10. 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.
  11. Kato, R.; Sasaki, Y. (2017). "On Using Linear Quantile Regressions for Causal Inference". Econometric Theory . 33 (3): 664–690. doi: 10.1017/S0266466616000177 .
  12. 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
  13. 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.
  14. 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.
  15. 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.
  16. Steinwart, Ingo; Christmann, Andreas (2011). "Estimating conditional quantiles with the help of the pinball loss". Bernoulli. Bernoulli Society for Mathematical Statistics and Probability. 17 (1): 211–225. arXiv: 1102.2101 . doi:10.3150/10-BEJ267.
  17. Petneházi, Gábor (2019-08-21). "QCNN: Quantile Convolutional Neural Network". arXiv: 1908.07978 [cs.LG].
  18. Rodrigues, Filipe; Pereira, Francisco C. (2018-08-27). "Beyond expectation: Deep joint mean and quantile regression for spatio-temporal problems". arXiv: 1808.08798 [stat].
  19. 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
  20. Meinshausen, Nicolai (2006). "Quantile Regression Forests" (PDF). Journal of Machine Learning Research. 7 (6): 983–999.
  21. 1 2 Portnoy, S. L. (2003). "Censored Regression Quantiles". Journal of the American Statistical Association . 98 (464): 1001–1012. doi:10.1198/016214503000000954. S2CID   120674851.
  22. 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.
  23. Powell, James L. (1986). "Censored Regression Quantiles". Journal of Econometrics . 32 (1): 143–155. doi:10.1016/0304-4076(86)90016-3.
  24. 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.
  25. 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
  26. "quantreg(x,y,tau,order,Nboot) - File Exchange - MATLAB Central". www.mathworks.com. Retrieved 2016-02-01.
  27. "Gretl Command Reference" (PDF). April 2017.
  28. "quantreg: Quantile Regression". R Project. 2018-12-18.
  29. "gbm: Generalized Boosted Regression Models". R Project. 2019-01-14.
  30. "quantregForest: Quantile Regression Forests". R Project. 2017-12-19.
  31. "qrnn: Quantile Regression Neural Networks". R Project. 2018-06-26.
  32. "qgam: Smooth Additive Quantile Regression Models". R Project. 2019-05-23.
  33. "Quantile Regression Forests". Scikit-garden. Retrieved 3 January 2019.
  34. "Statsmodels: Quantile Regression". Statsmodels. Retrieved 15 November 2019.
  35. "An Introduction to Quantile Regression and the QUANTREG Procedure" (PDF). SAS Support.
  36. "The QUANTSELECT Procedure". SAS Support.
  37. "qreg — Quantile regression" (PDF). Stata Manual.
  38. 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.
  39. "JohnLangford/vowpal_wabbit". GitHub. Retrieved 2016-07-09.
  40. "QuantileRegression.m". MathematicaForPrediction. Retrieved 3 January 2019.
  41. "QuantileRegression". Wolfram Function Repository. Retrieved 14 September 2022.