Why the Target of Absolute Error Matters
Least-absolute-deviations (LAD) regression chooses coefficients to minimize the sum of absolute residuals. That choice is not just a different computational way to fit a line: it changes the quantity the fitted line is designed to describe. Squared-error fitting is associated with a conditional mean; absolute-error fitting is associated with a conditional median. The reason comes from the shape of the loss function and can be derived directly.
This distinction matters when the conditional distribution of the response is skewed or has unusual values. The mean and median can then differ, so two fitting criteria can give different answers without either calculation being erroneous. The key is to interpret the fitted quantity correctly.
Expected Absolute Error at a Fixed Predictor Value
Fix \(X=x\), and consider predicting \(Y\) with a single number \(a\). The prediction incurs absolute error \(|Y-a|\). Its conditional expected loss is \(L_x(a)=E(|Y-a|\mid X=x)\), assumed finite for the candidate values under consideration. The question is: which \(a\) minimizes this expectation?
Let \(F_x(a)=P(Y\leq a\mid X=x)\) be the conditional distribution function, and let \(F_x(a-)=P(Y<a\mid X=x)\). The one-sided derivatives of the expected absolute loss are
These expressions also apply when the distribution has point masses. Intuitively, moving the prediction a small amount to the right reduces the error for responses above the prediction and increases it for responses below. The balance depends on how much probability lies on either side, not on how far away the responses are.
Deriving the Median Condition
For a convex function, a point minimizes the function precisely when its left derivative is at most zero and its right derivative is at least zero. The expected absolute loss is convex in \(a\), since \(|y-a|\) is convex in \(a\) for every fixed \(y\), and an expectation preserves convexity. Applying this minimum condition gives
The right-hand condition is exactly the condition that \(a\) be a conditional median. Thus every conditional median minimizes expected absolute error, and every minimizer of that expected loss is a conditional median.
For a continuous conditional distribution, there is no probability mass at \(a\), so \(F_x(a-)=F_x(a)\). In that case, an interior minimum satisfies \(F_x(a)=0.5\). With a discrete distribution, the distribution function can jump over 0.5, and any value at the jump satisfying the median condition minimizes the loss. A flat interval of minimizers is also possible.
Worked Example: A Discrete Conditional Distribution
Worked Example: A Discrete Conditional Distribution
Suppose that, at predictor value \(x\), a hypothetical response has the following conditional distribution: \(Y=9+2x\) with probability 0.25, \(Y=10+2x\) with probability 0.50, and \(Y=14+2x\) with probability 0.25. Find its conditional median and mean, and compare the absolute losses at the three possible response values.
The cumulative probability reaches 0.25 at \(9+2x\) and 0.75 at \(10+2x\). Therefore \(10+2x\) is a conditional median. Its expected absolute loss is
At the lower response value, \(9+2x\), the expected absolute loss is \(0.25(0)+0.50(1)+0.25(5)=1.75\). At the upper response value, \(14+2x\), it is \(0.25(5)+0.50(4)+0.25(0)=3.25\). The median gives the smallest of these losses.
The conditional mean is
The conditional median is \(10+2x\), whereas the conditional mean is \(10.75+2x\). Both have slope 2 in this example, but their intercepts differ. The difference illustrates why an absolute-error fit should not automatically be described as estimating the conditional mean.
From a Conditional Target to LAD Coefficients
In a regression, the prediction is restricted to have a particular form. For a predictor vector \(X\) and coefficient vector \(\beta\), write the prediction as \(X^\mathsf{T}\beta\). The population absolute-error criterion is
If predictions could be chosen separately at every predictor value, the result just derived says to choose a conditional median at each value. Regression imposes a restriction: the predictions must all come from one coefficient vector. If the conditional median has the linear form
then \(\beta_0\) gives a linear model for that conditional median. Under this correct specification, and when the predictors identify the coefficients, minimizing expected absolute error targets \(\beta_0\). In a sample, LAD regression minimizes the corresponding sum of absolute residuals,
The sample criterion is an estimate of the population criterion. It does not guarantee that the fitted coefficients equal the population coefficients in a particular sample; sampling variation remains. Nor does the median-target result require conditional errors to be symmetric around zero. What matters for the interpretation is that the conditional median is represented by the chosen regression form.
Worked Example: A LAD Line From Two Predictor Groups
Consider hypothetical observations with a single predictor \(x\). At \(x=0\), the responses are 1, 2, and 8. At \(x=1\), they are 3, 4, and 10. Find the line that minimizes the sum of absolute residuals for this data.
Write the line as \(\hat{y}=b_0+b_1x\). Its prediction at \(x=0\) is \(b_0\), and its prediction at \(x=1\) is \(b_0+b_1\). Because these two predictions can be chosen freely by choosing \(b_0\) and \(b_1\), the total absolute loss separates into the loss for each group.
For the \(x=0\) group, the median response is 2. The absolute loss at that prediction is \(|1-2|+|2-2|+|8-2|=1+0+6=7\). For the \(x=1\) group, the median response is 4, with loss \(|3-4|+|4-4|+|10-4|=1+0+6=7\). The combined loss is \(7+7=14\).
The line through these two conditional group medians has \(b_0=2\) and \(b_0+b_1=4\), so \(b_1=4-2=2\). Thus the LAD line is \(\hat{y}=2+2x\), with total absolute residual loss 14. Each group has an odd number of observations and a unique median, so its prediction minimizes that group’s absolute loss. Since the two group predictions determine the line, this line minimizes the total loss.
This example shows how LAD fitting can connect regression coefficients to conditional medians. It does not establish that a straight line is appropriate for every conditional median relationship; that is a modeling question.
Worked Example: A Skewed Conditional Distribution
Worked Example: A Skewed Conditional Distribution
Suppose a hypothetical response has the form \(Y=5+1.2x+U\), where, conditional on \(X=x\), \(U\) has an exponential distribution with density \(f(u)=\frac12e^{-u/2}\) for \(u\geq0\). Find the conditional median and mean at \(x=2\).
For \(u\geq0\), the distribution function of \(U\) is \(F_U(u)=\int_0^u \frac12e^{-v/2}\,dv=1-e^{-u/2}\). The median solves \(F_U(u)=0.5\), so \(1-e^{-u/2}=0.5\), \(e^{-u/2}=0.5\), and \(u=2\ln 2\), approximately 1.386. The conditional location \(5+1.2x\) at \(x=2\) is \(5+1.2(2)=7.4\). Therefore the conditional median is \(7.4+1.386=8.786\).
The exponential variable \(U\) has mean 2, so the conditional mean at \(x=2\) is \(7.4+2=9.4\). The conditional distribution is right-skewed: the mean is larger than the median. The expected absolute loss is minimized at 8.786, not at 9.4, because its minimum occurs where the conditional distribution function reaches 0.5.
Across predictor values, the conditional median in this example is \(5+1.2x+2\ln 2\), a straight line with slope 1.2 and intercept \(5+2\ln2\). The conditional mean is also linear here, but has intercept 7 rather than \(5+2\ln2\). The lines differ because the conditional error distribution is skewed, even though its shape is shifted by the same amount as \(x\) changes.
What the Linear Assumption Does—and Does Not—Say
A linear LAD fit is most directly interpreted as a model for the conditional median when the conditional median is in fact linear in the predictors. If that form is wrong, the LAD coefficients still minimize the chosen absolute-error criterion within the restricted family of linear predictions. They should then be understood as the best-fitting linear approximation under that criterion, not automatically as the coefficients of the true conditional median at every predictor value.
In an ordinary linear model with an intercept, a fitted LAD solution has residuals balanced around zero in the sense that the optimization accounts for their signs and magnitudes through absolute loss. This is not a claim that exactly half of the residuals are positive and half negative in every sample, especially when there are ties or multiple optimal solutions. The population interpretation is about conditional medians, not a mechanical count in a particular data set.
Common Mistake: Calling the LAD Fit a Mean Model
A common mistake is to say, “The LAD line predicts the average response because it is a regression line.” That reasoning confuses the regression format with the target of its loss function. The correction is to identify the criterion first: squared error targets a conditional mean under the corresponding unrestricted pointwise argument, whereas absolute error targets a conditional median. Then check whether the regression’s linear form is a suitable model for the conditional quantity being discussed.
A second mistake is to assume that skewness or asymmetry invalidates the median result. It does not. The derivation uses the conditional distribution function and does not require symmetry. In fact, asymmetry is a reason the conditional mean and median may differ, making it especially important to name the target accurately.
Check Your Understanding
Use the loss function and conditional distribution to justify each answer.
- For a fixed \(x\), what condition on \(F_x(a-)\) and \(F_x(a)\) characterizes a value \(a\) that minimizes expected absolute error?
- A conditional distribution has probability 0.40 below 3, probability 0.30 at 3, and probability 0.30 above 3. Is 3 a conditional median? Explain using the median condition.
- Why can an LAD line differ from a line intended to model the conditional mean when the conditional response distribution is skewed?
- If the true conditional median is curved in \(x\), what can still be said about the linear LAD fit, and what cannot be assumed about it?
- Does the conditional-median result require a symmetric or normal conditional distribution? State the reasoning briefly.