Linear regression: why is distance *squared* used as an error metric? Usually when performing linear regression predictions and gradient descent, the measure of the level of error for a particular line will be measured by the sum of the squared-distance values.

Why distance squared?

In most of the explanations I heard, they claim that:


the function itself does not matter
the result should be positive so positive and negative deviations are still counted


However, an abs() approach would still work. And isn't it inconvenient that distance squared minimizes the distance result for distances lower than 1?

I'm pretty sure someone must have considered this already -- so why is distance squared the most used approach to linear regression?
The squared form is sometimes called the Euclidean norm or L2 norm. One of its very helpful properties is that it has an easily defined derivative, which can be used in mathematical analysis and translated fairly easily into code.

Intuitively it is thought that it is advantageous to exaggerate the differences according to the value of the error, which squaring does. You might also use the powers 3 or 4, but the derivative is more complex.

A number of different norms may be used, according to the particular circumstances of the problem at hand.