Displaying 1 result from an estimated 1 matches for "zinegbinomi".
Did you mean:
  zinegbinomial
  
2008 Apr 18
2
rzinb (VGAM) and dnbinom in optim
...ing the zero-inflated neg binom
#I get the same problem without VGAM, using dnbinom in the wrapper instead.
library(VGAM)
phi <- 0.09
size <- 0.7
munb <- 72
x <- rzinb(200, phi=phi, size=size, munb=munb)
#VGAM can fit using vglm... but I'd like to try optim
> fit <- vglm(x~1, zinegbinomial,trace=TRUE)
VGLM    linear loop  1 :  loglikelihood = -964.1915
VGLM    linear loop  2 :  loglikelihood = -964.1392
VGLM    linear loop  3 :  loglikelihood = -964.1392
> Coef(fit)
       phi       munb          k 
 0.1200317 62.8882874  0.8179183 
> #build my wrapper function for dzinb
>...