18
$\begingroup$

The linear regression model makes a bunch of assumptions that quantile regression does not and, if the assumptions of linear regression are met, then my intuition (and some very limited experience) is that median regression would give nearly identical results as linear regression.

So, what advantages does linear regression have? It's certainly more familiar, but other than that?

$\endgroup$
7
  • 3
    $\begingroup$ To 'more familiar' i'd add 'interpretability' and 'stability', but for me one of the advantages of linear regression is what it tells you about the mean and how well that mean represents the sample population (residuals are very informative). Linear regression has as great value when its assumptions are met and good value when they are not met. $\endgroup$ Commented Mar 9, 2019 at 2:08
  • 6
    $\begingroup$ I would argue that one important issue has been discussed in these two threads: stats.stackexchange.com/questions/153348/… and stats.stackexchange.com/questions/146077/… -- efficiency, and, possibly, even optimality under certain assumptions $\endgroup$ Commented Mar 9, 2019 at 9:30
  • 1
    $\begingroup$ As a further, but minor, point, one could maybe add the availbility of explicit, closed form solutions that are not available for, say, LAD, which may make such techniques less appealing for practitioners. $\endgroup$ Commented Mar 11, 2019 at 11:45
  • 1
    $\begingroup$ An answer could be like comparing the simple case of estimating a single population parameter, then showing that least squared errors performs better with Gaussian errors and least absolute residuals (using assumptions as well) performs better for different type of errors. But then, this question is about more complex linear models and the problem starts to be more complex and broad. The intuition of the simple problem (estimating a single mean/median) works for a bigger model, but by how much should it be worked out? And how to compare, robustness against outliers, distributions, computation? $\endgroup$ Commented Mar 12, 2019 at 9:01
  • 2
    $\begingroup$ In my case, I have found quantile regression much nicer to explain to non-technical people when the response variable is skewed (e.g. customer expenditure) and the introduction of a transformation/link-function step obscures the whole analysis. In that sense I would contest the assertion "median regression would give nearly identical results as linear regression" as being a bit oversimplifying; it does not, especially when dealing with potentially skewed response variables. $\endgroup$
    – usεr11852
    Commented Mar 12, 2019 at 12:57

3 Answers 3

14
+100
$\begingroup$

It is very often stated that minimizing least squared residuals is preferred over minimizing absolute residuals because of the reason that it is computationally simpler. But, it may also be better for other reasons. Namely, if the assumptions are true (and this is not so uncommon) then it provides a solution that is (on average) more accurate.

Maximum likelihood

Least squares regression and quantile regression (when performed by minimizing the absolute residuals) can be seen as maximizing the likelihood function for Gaussian/Laplace distributed errors, and are in this sense very much related.

  • Gaussian distribution:

    $$f(x) = \frac{1}{\sqrt{2\pi \sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$

    with the log-likelihood being maximized when minimizing the sum of squared residuals

    $$\log \mathcal{L}(x) = -\frac{n}{2} \log (2 \pi) - n \log(\sigma) - \frac{1}{2\sigma^2} \underbrace{\sum_{i=1}^n (x_i-\mu)^2}_{\text{sum of squared residuals}} $$

  • Laplace distribution:

    $$f(x) = \frac{1}{2b} e^{-\frac{\vert x-\mu \vert}{b}}$$

    with the log-likelihood being maximized when minimizing the sum of absolute residuals

    $$\log \mathcal{L}(x) = -n \log (2) - n \log(b) - \frac{1}{b} \underbrace{\sum_{i=1}^n |x_i-\mu|}_{\text{sum of absolute residuals}} $$

Note: the Laplace distribution and the sum of absolute residuals relates to the median, but it can be generalized to other quantiles by giving different weights to negative and positive residuals.

Known error distribution

When we know the error-distribution (when the assumptions are likely true) it makes sense to choose the associated likelihood function. Minimizing that function is more optimal.

Very often the errors are (approximately) normal distributed. In that case using least squares is the best way to find the parameter $\mu$ (which relates to both the mean and the median). It is the best way because it has the lowest sample variance (lowest of all unbiased estimators). Or you can say more strongly: that it is stochastically dominant (see the illustration in this question comparing the distribution of the sample median and the sample mean).

So, when the errors are normal distributed, then the sample mean is a better estimator of the distribution median than the sample median. The least squares regression is a more optimal estimator of the quantiles. It is better than using the least sum of absolute residuals.

Because so many problems deal with normal distributed errors the use of the least squares method is very popular. To work with other type of distributions one can use the Generalized linear model. And, the method of iterative least squares, which can be used to solve GLMs, also works for the Laplace distribution (ie. for absolute deviations), which is equivalent to finding the median (or in the generalized version other quantiles).

Unknown error distribution

Robustness

The median or other quantiles have the advantage that they are very robust regarding the type of distribution. The actual values do not matter much and the quantiles only care about the order. So no matter what the distribution is, minimizing the absolute residuals (which is equivalent to finding the quantiles) is working very well.

The question becomes complex and broad here and it is dependent on what type of knowledge we have or do not have about the distribution function. For instance a distribution may be approximately normal distributed but only with some additional outliers. This can be dealt with by removing the outer values. This removal of the extreme values even works in estimating the location parameter of the Cauchy distribution where the truncated mean can be a better estimator than the median. So not only for the ideal situation when the assumptions hold, but also for some less ideal applications (e.g. additional outliers) there might be good robust methods that still use some form of a sum of squared residuals instead of sum of absolute residuals.

I imagine that regression with truncated residuals might be computationally much more complex. So it may actually be quantile regression which is the type of regression that is performed because of the reason that it is computationally simpler (not simpler than ordinary least squares, but simpler than truncated least squares).

Biased/unbiased

Another issue is biased versus unbiased estimators. In the above I described the maximum likelihood estimate for the mean, ie the least squares solution, as a good or preferable estimator because it often has the lowest variance of all unbiased estimators (when the errors are normal distributed). But, biased estimators may be better (lower expected sum of squared error).

This makes the question again broad and complex. There are many different estimators and many different situations to apply them. The use of an adapted sum of squared residuals loss function often works well to reduce the error (e.g. all kinds of regularization methods), but it may not need to work well for all cases. Intuitively it is not strange to imagine that, since the sum of squared residuals loss function often works well for all unbiased estimators, the optimal biased estimators is probably something close to a sum of squared residuals loss function.

$\endgroup$
12
  • $\begingroup$ When we know the error-distribution it makes sense to choose the associated likelihood function. Minimizing that function is more optimal. Not to say this is wrong, but should probably be qualified. Of course, this relates once again to my question (that you answered) on optimal estimators under different loss functions. $\endgroup$ Commented Mar 12, 2019 at 16:41
  • 1
    $\begingroup$ @RichardHardy this topic is so broad. Indeed the error = variance + bias. I assumed bias of the sample mean is the same as the sample median (or more general: least sum of squared residuals and least sum of absolute residuals have the same bias). This is true given various error distributions (e.g. symmetric error distributions), but indeed the questions becomes more complex for other cases. (the point was mainly that errors are often normal distributed and this makes least squares regression favourable) $\endgroup$ Commented Mar 12, 2019 at 16:55
  • 1
    $\begingroup$ The same (the complexity of the question) is true when we do not consider the median, but instead some other quantile. In the case of normal distributed errors I believe that the MLE gives the best result for whatever quantile, but I agree that it's intuition. Again the problem is very broad (dependency on the number of samples, type of distribution of errors and certainty about it, etc,). $\endgroup$ Commented Mar 12, 2019 at 16:56
  • 1
    $\begingroup$ a broken clock is exactly right twice a day, I would not call the MLE a broken clock. Sure, when you know the problem well, then you can introduce some variance reducing bias to improve the overall error. This is not necessarily moving to a different (quantile) type of regression, you can also just put some jam or honey on the least squares bread and butter. If you do wish to compare MLE to a broken clock then it is a clock that happens to be standing still around the time that we make the most use of. $\endgroup$ Commented Mar 13, 2019 at 8:56
  • 1
    $\begingroup$ An edit was suggested to change this post relating to OLS being the best unbiased estimator, independent from the error distribution being normal, because it is the best linear unbiased estimator. However, this post and question are not about linear estimators. Quantile regression does not give a linear estimate. $\endgroup$ Commented Apr 8 at 18:52
2
$\begingroup$

Linear regression (LR) boils down to least squares optimization when computing its coefficients. This implies a symmetry in the deviations from the regression model. A good explanation of quantile regression (QR) is in https://data.library.virginia.edu/getting-started-with-quantile-regression/.

If LR assumptions (needed for inference: p-values, confidence intervals, etc.) are satisfied QR and LR predictions will be similar. But if the assumptions are strongly violated, your standard LR inference will be wrong. So a 0.5 quantile (median) regression presents an advantage over LR. It also gives more flexibility in providing regression for other quantiles. The equivalent for linear models would be a confidence bound computed from a LR (although this would be wrong if iid is strongly violated).

So what is the advantage of LR? Of course it's easier to compute but if your data set is of reasonable size that may not be very noticeable. But more importantly, the LR inference assumptions provide information that lowers uncertainty. As a result, LR confidence intervals on predictions will typically be narrower. So if there is strong theoretical support for the assumptions, narrower confidence intervals may be an advantage.

$\endgroup$
2
$\begingroup$

Linear regression is used to estimate the conditional mean response given the data, i.e. $E(Y \vert X)$ where $Y$ is the response and $X$ is the data. The regression tells us that $E(Y \vert X)= X \beta$. There are certain assumptions (you can find them in any stats text) for inference to be valid. If these are satisfied then generally the standard estimator for $\beta$ is the BLUE (best linear unbiased estimator -- see Gauss-Markov theorem).

Quantile regression can be used to estimate ANY quantile of the conditional distribution including the median. This provides potentially a lot more information than the mean about the conditional distribution. If the conditional distribution is not symmetric or the tails are possibly thick (e.g. risk analysis), quantile regression is helpful EVEN if all the assumptions of linear regression are satisfied.

Of course, it is numerically more intensive to carry out quantile estimation relative to linear regression but it is generally much more robust (e.g. just as the median is more robust than the mean to outliers). In addition, it is appropriate when linear regression is not -- e.g. for censored data. Inference may be trickier as direct estimation of variance-covariance matrix may be difficult or computationally expensive. In those cases, one can bootstrap.

$\endgroup$
1
  • $\begingroup$ OLS being the best linear unbiased estimator (BLUE) doesn't make it neccesarily an estimator with less error than a quantile regression estimator. The reason is because quantile regression is not a linear estimator and can be better than the BLUE. $\endgroup$ Commented Apr 8 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.