I have data with a double peak that I'm trying to model, and there's enough overlap between the peaks that I can't treat them independently. A histogram of the data might look something like this:
I've created two models for this: one uses two Poisson distributions, and the other uses two negative binomial distributions (to account for overdispersion). What's the appropriate way to tell which model fits the data more accurately?
My initial thought is that I could use a Kolmogorov-Smirnov test to compare each model to the data, then do a likelihood ratio test to see if one is a significantly better fit. Does this make sense? If so, I'm not exactly sure how to perform the likelihood ratio test. Is chi-squared appropriate, and how many degrees of freedom do I have?
If it helps, some (very simplified) R code for the models might look something like this:
## inital data points a <- read.table("data") #create model data model.pois = c(rpois(1000000,200),rpois(500000,250)) model.nb = c(rnbinom(1000000,200,0.5),rnbinom(500000,275,0.5) #Kolmogorov-Smirnov test #use ks.boot, since it's count data that may contain duplicate values kpois = ks.boot(model.pois,a) knb = ks.boot(model.nb,a) #here's where I'd do some sort of likelihood ratio test # . . .
Edit: Here's an image that may explain the data and the distributions I'm fitting better. It's totally clear from the visualization that the second model (using the negative binomial dist to account for overdispersion) is a better fit. I'd like to show this quantitatively, though.
(red - data, green - model)