Consider the following sample: $(x_1, y_1) = (1, 1)$, $(x_2, y_2) = (2, 5)$, $(x_3, y_3) = (3, 8)$, $(x_4, y_4) = (4, 18)$.
How can I write down an optimisation problem that minimises the sum of absolute errors of the simple linear model $y = a + bx$.
Also, is this optimisation problem constrained? Is the objective function differentiable? (Optional: Is the objective function convex?)
For 1) is it going to be just: $$min\sum_{i=1}^{4}|y_i-(a+bx_i)|$$