0

I have loaded amsmath and then giving the equation

\begin{equation}
RMSE = \sum \limit_{i=1}^{d} \left (\frac{original(i)-predicted(i)}{original(i)} \right) ^ 2
\label{eq1}
\end{equation}

It gives undefined control sequence error, please help.

4
  • 7
    \limit is undefined you meant \limits but you can simply delete it as \limits does nothing there, \sum uses limits anyway. Aug 20, 2021 at 11:39
  • Thanks a lot, that answers my question, error is resolved now.
    – Debayan
    Aug 20, 2021 at 11:44
  • 3
    The error (which you didn't post for us to see) has a line break after \limit. That's how you know that \limit is the problem. But you should do something with RMSE and original, so that TeX doesn't think you're multiplying 4 or 8 variables.
    – Teepeemm
    Aug 20, 2021 at 12:49
  • Incidentally, that's not the RMSE ….
    – LSpice
    Aug 20, 2021 at 16:33

1 Answer 1

5

A quick fix:

enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
  \mathrm{RMSE} = \sum_{i=1}^{d}
  \left(\frac{\mathrm{original}(i)-\mathrm{predicted}(i)}{\mathrm{original}(i)}
  \right)^2
\label{eq1}
\end{equation}
\end{document}
2
  • 3
    It should be \mathrm instead of \textrm.
    – egreg
    Aug 20, 2021 at 15:47
  • 1
    @egreg, thanks for the reminder!! It's corrected.
    – citsahcots
    Aug 20, 2021 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .