search for: dzinb

Displaying 1 result from an estimated 1 matches for "dzinb".

Did you mean: zinb
2008 Apr 18
2
rzinb (VGAM) and dnbinom in optim
...negbinomial,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 > fncZiNB <- function(phi, size, munb){ + -sum(dzinb(x=x,phi=phi, size=size, munb=munb,log=TRUE))} > > #test the wrapper, seems to work. > fncZiNB(phi=0.09, size=0.7, munb=72) [1] 969.1435 #try it in optim > solut <- optim(fn=fncZiNB,par=c(phi=0.09, munb=72, size=0.7)...