Skip to content

Fitting Mixture distributions

3 messages · TJUN KIAT TEO, Rui Barradas, Simon Zehnder

#
Hello,

Try the following.


library(sos)
findFn('fitting mixture distribution')


It found several other packages.

Hope this helps,

Rui Barradas

Em 16-07-2013 21:59, Tjun Kiat Teo escreveu:
#
Hi Tjun Kiat Teo,

you try to fit a Normal mixture to some data. The Normal mixture is very delicate when it comes to parameter search: If the variance gets closer and closer to zero, the log Likelihood becomes larger and larger for any values of the remaining parameters. Furthermore for the EM algorithm it is known, that it takes sometimes very long until convergence is reached. 

Try the following: 

Use as starting values for the component parameters:

start.par <- mean(your.data, na.rm = TRUE) + sd(your.data, na.rm = TRUE) * runif(K)

For the weights just use either 1/K or the R cluster function with K clusters

Here K is the number of components. Further enlarge the maximum number of iterations. What you could also try is to randomize start parameters and run an SEM (Stochastic EM). In my opinion the better method is in this case a Bayesian method: MCMC.


Best

Simon
On Jul 16, 2013, at 10:59 PM, Tjun Kiat Teo <teotjunk at gmail.com> wrote: