Is the solution to Mean Squared Error also the one to Mean Absolute Error

linear programmingoptimizationstatistics

When I was dealing with optimization problem and deciding whether to minimize MSE or MAE, I had the following question: Is the solution to Mean Squared Error also the one to Mean Absolute Error? If yes, why would we choose one model over the other?

Best Answer

Consider $x_1,\ldots,x_n\in \mathbb R$.

The solution of the MSE problem is $\text{argmin}_x \sum_{k=1}^n (x_i-x)^2 = \{\frac 1n \sum_{k=1}^n x_i\}$ which you might know as the sample mean.

The solution of the MAE problem is $\text{argmin}_x \sum_{k=1}^n |x_i-x| = \{\text{medians of }(x_1,\ldots,x_n) \}$.

In general, the sample mean is not a median of $(x_1,\ldots,x_n)$, so the solutions of both problems are different.


Using this result with the distribution that puts mass $\frac 1n$ on each sample, the difference between the two solutions must be less than $\displaystyle \sqrt{\frac 1n\sum_{k=1}^n (x_k-\overline x)^2}$ where $\overline x = \frac 1n \sum_{k=1}^n x_k$.