# Mixture model for a mix of normal and lognormal distributions in R

I have a distribution composed of a mixture of a normal distribution and a log-normal distribution. A simulated example that looks quite similar to what I will expect in the real data would be:

x.norm<-rnorm(10000, 0.18, 0.2)
x.lnorm<-rlnorm(4000, 0.6,0.5)

x<-c(x.norm, x.lnorm)


I would like to find a way to implement a mixture model within R to discern the underlying subpopulations within the distribution. I have used the mixtools implementation of the mixed of normal distributions as implemented in the command normalmixEM(), and although it estimates the parameters quite closely to the real distributions, I wonder wether there is an implementation within R to get closer to the mixture of normal and lognormal distributions that I expect my data to have. The output of mixtools is also quite good as it gives the posterior probability of each value to belong to one of the clusters. This is particularly interesting as the normal distribution corresponds to background noise, whilst the log-normal distribution is real signal.

If there isn't an already made implementation, I know how to write the expectation-maximization (EM) algorithm for normal distributions, but I'm not sure how to do this for the log-normal part of the distribution. Any hints on this?

• The EM steps are exactly the same, except that one of the two components uses logarithms of the (positive) observations and that the negative observations are automatically allocated to the Normal component. – Xi'an May 20 at 7:15