Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have the equations $$sMAPE = n^{-1}\sum_{i=1}^n\left|\frac{y_i - f_i}{(y_i+f_i)/2}\right|$$ and $$sMAPE = n^{-1}\sum_{i=1}^n \frac{|y_i-f_i|}{(|y_i|+|f_i|)/2}$$ but I don't understand what $|$ means.

share|cite|improve this question
Absolute values. –  Andrés Caicedo Feb 1 '13 at 2:57

2 Answers 2

up vote 2 down vote accepted

As Andres Caicedo points out in the comments, this symbol is absolute value.

What it does is tell you how far away from $0$ a number is. For instance $\lvert -5 \rvert$ would be $5$ because it is $5$ steps away from $0$.

This causes a difference between the two equations because we are taking this at different times For example

$$\lvert 5 - (-5) \rvert = 10$$ But $$\lvert 5 \rvert - \lvert -5 \rvert = 5 - 5 = 0$$

share|cite|improve this answer

I'm not sure anyone actually answered the question in your title post. Andres's comment and Deven's answer tell you what the vertical bar means, and Deven hints at why the two expressions aren't equal. But if you want it spelled out:

It turns out that the absolute value of a quotient is the quotient of the absolute values, i.e. $$\left|\frac{a}{b}\right|=\frac{|a|}{|b|}$$ It follows that $$\left|\frac{y_i-f_i}{(y_i+f_i)/2}\right|=\frac{|y_i-f_i|}{|(y_i+f_i)/2|}=\frac{|y_i-f_i|}{|y_i+f_i|/2}$$ On the other hand, in general, we have $$|a+b|\neq|a|+|b|$$ although this statement does become true if $a$ and $b$ have the same sign. So you can't conclude that $$|y_i+f_i|=|y_i|+|f_i|$$ unless you know that $y_i$ and $f_i$ have the same sign.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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