4

Here EM algorithm manually implemented, there's a question of the implementation in R of the EM algorithm for 2 mixed gaussians. The answer has a supposedly correct implementation.

However, don't the lines

  sigma1 <- sum(tau1*(x-mu1)^2)/sum(tau1)
  sigma2 <- sum(tau2*(x-mu2)^2)/sum(tau2)

estimate the variance? In the next iteration of the loop, they use these values to create normal random variables:

dnorm(dat,mean=mu1,sd=sigma1)
dnorm(dat,mean=mu2,sd=sigma2)

so they are assuming that the variables represent the standard deviation. I don't understand why the algorithm works. Should it? Why?

John Doe
  • 141
  • 3
  • 1
    In the post you put in link, there is the answer to your question. Yes it is false here. You have variance in the first step then it is standard deviation in the argument of dnorm. – PauZen Jul 11 '19 at 22:03

0 Answers0