I have managed to write the whole equation
using the following code in Rmarkdown
$$MAPE = \frac{1}{n} \sum_{d_i} (\frac{1}{q} \sum_{t_j}
\abs{\frac{gap_{i,j}-s_{i,j}}{gap_{i,j}}} )$$
However, in Rmarkdown, the code above returns:
Could anyone help figure out how to get abs
right here?
Thanks
Expanding on Andrie's answer:
Another way to write absolute value is
\lvert -3 \rvert
To automatically adjust the size of the vertical lines to what's inside them, use
\left\lvert -3 \right\rvert
In your case, this becomes:
$$MAPE = \frac{1}{n} \sum_{d_i} (\frac{1}{q} \sum_{t_j}\left\lvert{\frac{gap_{i,j}-s_{i,j}}{gap_{i,j}}}\right\rvert)$$
edit: When I originally posted this answer, I couldn't embed images yet. Now replaced link with embed.
Using mathjax, you can use the "pipe" symbol |
to indicate absolute values.
Try this:
$$ |-3| $$
In your case:
$$MAPE = \frac{1}{n} \sum_{d_i} (\frac{1}{q} \sum_{t_j} |\frac{gap_{i,j}-s_{i,j}}{gap_{i,j}}| )$$
This gives:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With