I applied this code and I get this error over and over again.
library(mixtools)
simulate <- function(lambda=0.3, mu=c(0, 4), sd=c(1, 1), n.obs=10^5) {
x1 <- rnorm(n.obs, mu[1], sd[1])
x2 <- rnorm(n.obs, mu[2], sd[2])
return(ifelse(runif(n.obs) < lambda, x1, x2))
}
x <- simulate()
model <- normalmixEM(x=x, k=2)
Error: object 'C_normpost' not found
Can anyone help me with this?
If on the other hand someone can think of a way to separate two binomial distributions it would be great.