NaNs produced in negative binomial regression when using dnbinom()
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 3 years ago . I am using dnbinom() for writing the log-likelihood function and then estimate parameters using mle2() {bbmle} in R. The problem is that I got 16 warnings for my negative binomial model, all of them NaNs produced like this one: 1: In dnbinom(y, mu = mu, size = k, log = TRUE) : NaNs produced My code: # data x <- c(0.35,0.45,0.90,0.05,1.00,0.50,0.45,0.25,0.15,0.40,0.26,0.37,0.43