All the below equations work in CodeCogs but I am still getting an error for them in Texmaker. \begin{equation} is line 501

P(c)= \frac{1}{n} \sum_{i=1}^{n} P(c\vert\vec{x_i})

\mu_{c,j} = \sum_{i=1}^{n} (\frac{P(c\vert\vec{x_i})}{nP(c)})x_{i,j}

(\sum_{c})_{j,k} = \sum_{i=1}^{n}(\frac{P(c\vert\vec{x_i})}{nP(c)})(x_{i,j} - \mu_{c,j})(x_{i,k} - \mu_{c,k})

 P(c\vert\vec{x_i}) = \frac{P(\vec{x_i}\vertc)P(c))}{\sum_{i=1}^{k}P(\vec{x_i}\vertc)P(c)}

P(\vec{x_i}|c) = \frac{1}{\sqrt{2\pi(\sum_{c})}} exp(- \frac{1}{2}(\vec{x_i} - \vec{\mu_c})^T \sum_{c}^{-1}(\vec{x_i} - \vec{\mu_c}))


! Missing $ inserted.
<inserted text>

I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
  • 4
    Welcome to TeX.SE. There must be no empty line after \begin{equation} or \end{equation} .etc. In addition, equation is not the right tool for this. Use align instead, for example. What is codecogs?
    – user31729
    Jun 2 '17 at 6:44
  • online latex equation editor codecogs.com/latex/eqneditor.php Jun 2 '17 at 6:51
  • its still not working Jun 2 '17 at 6:52

Apart from the missing \\s to terminate the lines, I strongly suggest you read the amsmath package documentation.

I could not find the vertc symbol anyway, which I translated in \vert c.

Do not leave empty lines inside math;

I also manually adjusted the height of the brackets, and substituted exp with the proper operator \exp.

I also substituted (\sum_c)_{j,k} with \sum_c{\mathstrut}_{j,k} to get rid of the parenthesis

I hope to have caught everything

P(c)= \frac{1}{n} \sum_{i=1}^{n} P(c\vert\vec{x_i})\\
\mu_{c,j} = \sum_{i=1}^{n} \Bigl(\frac{P(c\vert\vec{x_i})}{nP(c)}\Bigr)x_{i,j}\\
\sum_{c}{\mathstrut}_{j,k} = \sum_{i=1}^{n}\Bigl(\frac{P(c\vert\vec{x_i})}{nP(c)}\Bigr)(x_{i,j} - \mu_{c,j})(x_{i,k} - \mu_{c,k})\\
 P(c\vert\vec{x_i}) = \frac{P(\vec{x_i}\vert c)P(c))}{\sum_{i=1}^{k}P(\vec{x_i}\vert c)P(c)}\\
P(\vec{x_i}|c) = \frac{1}{\sqrt{2\pi\sum_{c}}} \exp\Bigl(- \frac{1}{2}(\vec{x_i} - \vec{\mu_c})^T \sum_{c}^{-1}(\vec{x_i} - \vec{\mu_c})\Bigr)

enter image description here

  • You beat me by 2 seconds
    – CarLaTeX
    Jun 2 '17 at 7:04
  • @CarLaTeX but still working on it :) ahhaha the fastest of the west
    – Moriambar
    Jun 2 '17 at 7:05
  • You'll beat egreg!
    – CarLaTeX
    Jun 2 '17 at 7:06
  • @Moriambar: Hm, the coughing never stops
    – user31729
    Jun 2 '17 at 7:26
  • 1
    @ChristianHupfer I understand: with all the allergies I sometimes start sneezing all around :)
    – Moriambar
    Jun 2 '17 at 7:28

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.