1
$\begingroup$

I'm not sure the above sentence is true, but I read it here, here and here that quantile loss function percentile 0.5 is MAE(mean absolute error), Is it true(Yes or No)? and How?

$\endgroup$
2
  • $\begingroup$ Perhaps "0.5" should be "50"? $\endgroup$ – whuber Dec 10 '19 at 16:26
  • $\begingroup$ I couldn't find out is it my answer,@S.Kolassa-ReinstateMonica $\endgroup$ – Farshid Shekari Dec 10 '19 at 17:13
5
$\begingroup$

Well mathematically speaking, quantile loss for quantile $\gamma$ is defined as:

$L_{\gamma}(y,y^p) = \sum_{i:y_i<\hat{y}_i}(1-\gamma)|y_i-\hat{y}_i| + \sum_{i:y_i\geq \hat{y}_i}(\gamma)|y_i-\hat{y}_i|$

For $\gamma=0.5$ (median), this becomes:

$L_{0.5}(y,y^p) = \sum_{i:y_i<\hat{y}_i}\frac{1}{2}|y_i-\hat{y}_i| + \sum_{i:y_i\geq \hat{y}_i}\frac{1}{2}|y_i-\hat{y}_i| = \sum\frac{1}{2}|y_i-\hat{y}_i|$

Considering that the MAE is:

$MAE = \frac{1}{n}\sum|y_i-\hat{y}_i|$

the two only differ by a constant, and they are therefore equivalent in terms of optimization.

$\endgroup$
4
  • $\begingroup$ according to the first equation, after replacing 0.5 in that, one of the coefficients is -0.5 and the second one is 0.5, and after summation, these coefficients disappear. $\endgroup$ – Farshid Shekari Dec 12 '19 at 5:18
  • $\begingroup$ Sorry I corrected, It was $1-\gamma$ and not $\gamma -1$ $\endgroup$ – Davide ND Dec 12 '19 at 6:49
  • $\begingroup$ I realized it might not have been clear - I just passed the two coefficients in fraction form because it was easier to compare to MAE $\endgroup$ – Davide ND Dec 12 '19 at 9:54
  • $\begingroup$ Can I use this loss to compare it with MAE? $\endgroup$ – Farshid Shekari Dec 15 '19 at 5:14

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