I have a relatively small dataset (160 observations), of which a very large number of my response variables are zero or very small (e.g., 131/160 values are 0; range 0-1.56). I had originally planned to use GLMM and select an appropriate distribution, but have not been able to find one that is a good fit. I've tried gamma, log-normal, Weibull, and beta.
I would like to try (and had recommended to me) Poisson and negative binomial, and also zero-inflated Poisson, but when I try to see how these fit using fitdist
(in fitdistr
) I get the following error message:
fitpois <- fitdist(variable_scaled, "pois")
simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, gr = gradient, ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower, upper = upper, ...): initial value in 'vmmin' is not finite> Error in fitdist(variable_scaled, "pois") : the function mle failed to estimate the parameters, with the error code 100
I have tried scaling the data to avoid having values of exactly zero in the data using:
variable_scaled <- (variable-min(variable)+0.001)/(max(variable)-min(variable)+0.002)
Any suggestions for what is causing the error code?
Thank you so much!