i'm trying to write this equation but LateX give me these errors. I already find similar question but any of them can solve the problem. Any suggestions?

\rho(X,Y) = {{{E(XY) - E(X)-E(Y)}\over{\sqrt{var(X)var(Y)}}}

Thanks in advance!


There is a missing } at the end of the equation. Or rather, a couple of extra {. You could simplify the input to:

\rho(X,Y) = {E(XY) - E(X)-E(Y) \over \sqrt{var(X)var(Y)}}

because the syntax for \over is {<subformula> \over <subformula>}, without the need of extra braces around the <subformula>s.

With proper LaTeX syntax and dedicated operators for E and var:

\rho(X,Y) = \frac{\E(XY)-\E(X)-\E(Y)}{\sqrt{\var(X)\var(Y)}}

enter image description here

  • thank you very much @Phelype! really clear explanation!! – Elisa m May 8 '19 at 14:19
  • 1
    @Elisam You're welcome. Glad it helped :-) – Phelype Oleinik May 8 '19 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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