I'm trying to fit a mixture of a gamma and negative binomial distribution to a data set in R. In the end the idea is to get the parameters of the two fitted distributions as well as a likelihood; something like this but, as far as I can tell, this package only does mixtures of the same type of distributions (two normal, two poisson, etc..)
I've looked arround and the R package that looks more promising is flexmix but I cannot get it to work. I've been trying with simpler examples (gaussian and poisson) but no good. So far this is what I've got:
ex1 <- stepFlexmix(y~x, data=data, k=2:5, model=list(FLXMRglm(.~., family="gaussian"), FLXMRglm(.~., family="poisson")), control=list(verb=5, iter=100))
Anyone has any idea on how to get it?
Thanks in advance,