I think my data might be described by a sum of Poisson distributions and I found out about mixdist
package for R. I managed to fit gamma and lnorm distributions, but I can't figure out how to use Poisson. I tried with the example data first:
library(mixdist)
data(poisdat)
data(poispar)
plot.mixdata(poisdat) #this works
fitp<-mix(poisdat, coef(poispar), "pois") #this doesn't
but I get an error Error in if (usecondit & ncol(mixdat) - 2 != k) stop("Conditional data are not consistent with mixpar.") : argument is of length zero
How to get a working example of mixdist and Poisson?