Generate values from a zero inflated negative binomial fit I am using the pscl package to fit a simple zeroinf(...,dist = "negbin"). I would like to simulate the probability distribution from this fit.
Using another post on cross validated (Simulate from a zero-inflated poisson distribution) I see the following for the poisson case, but I am not sure what to do for the negative binomial case
library("VGAM")
library("pscl")
object <- zeroinf(...)
p <- predict(object, ..., type = "zero")
lambda <- predict(object, ..., type = "count")
rzipois(n, lambda = lambda, pstr0 = p)


You can use the manual approach from Simulate from a zero-inflated poisson distribution and replace the rpois() call inside the ifelse() by an rnbinom() call.
We have also included a somewhat streamlined version of that code as rzinbinom() in the countreg package on R-Forge.
