Last chance! 50% off unlimited learning
Sale ends in
p0
.dzanegbin(x, p0, size, prob = NULL, munb = NULL, log = FALSE)
pzanegbin(q, p0, size, prob = NULL, munb = NULL)
qzanegbin(p, p0, size, prob = NULL, munb = NULL)
rzanegbin(n, p0, size, prob = NULL, munb = NULL)
length(n) > 1
then the length is taken to be the number required.dnbinom
).
Some arguments have been renamed slightly.p0=0
corresponds
to the response having a positive negative binomial distribution.dzanegbin
gives the density and
pzanegbin
gives the distribution function,
qzanegbin
gives the quantile function, and
rzanegbin
generates random deviates.p0
,
else a positive
$negative binomial(\mu_{nb}, size)$
distribution.zanegbinomial
,
rposnegbin
.munb <- 3; size <- 4; p0 <- 0.3; x <- (-1):7
(ii <- dzanegbin(x, p0 = p0, munb = munb, size = size))
table(rzanegbin(100, p0 = p0, munb = munb, size = size))
x = 0:10
barplot(rbind(dzanegbin(x, p0 = p0, munb = munb, size = size),
dnbinom(x, mu = munb, size = size)),
beside = TRUE, col = c("blue","green"), cex.main=0.7, las=1,
ylab = "Probability",names.arg = as.character(x),
main=paste("ZANB(p0=", p0, ", munb=", munb, ", size=", size,
") [blue] vs", " NB(mu=", munb, ", size=", size,
") [green] densities", sep=""))
Run the code above in your browser using DataLab