Generally–Altered, –Inflated and –Truncated Negative Binomial Distribution
Density, distribution function, quantile function and random generation for the generally–altered, –inflated and –truncated negative binomial distribution. Both parametric and nonparametric variants are supported; these are based on finite mixtures of the parent with itself and the multinomial logit model (MLM) respectively. Altogether it can be abbreviated as GAAIIT–NB(size.p, munb.p)–NB(size.a, munb.a)–MLM–NB(size.i, munb.i)–MLM, and it is also known as the GAIT-NB PNP combo where PNP stands for parametric and nonparametric.
dgaitnbinom(x, size.p, prob.p = NULL, munb.p = NULL, alt.mix = NULL, alt.mlm = NULL, inf.mix = NULL, inf.mlm = NULL, truncate = NULL, max.support = Inf, pobs.mix = 0, pobs.mlm = 0, pstr.mix = 0, pstr.mlm = 0, byrow.ai = FALSE, size.a = size.p, size.i = size.p, prob.a = prob.p, prob.i = prob.p, munb.a = munb.p, munb.i = munb.p, deflation = FALSE, log = FALSE) pgaitnbinom(q, size.p, prob.p = NULL, munb.p = NULL, alt.mix = NULL, alt.mlm = NULL, inf.mix = NULL, inf.mlm = NULL, truncate = NULL, max.support = Inf, pobs.mix = 0, pobs.mlm = 0, pstr.mix = 0, pstr.mlm = 0, byrow.ai = FALSE, size.a = size.p, size.i = size.p, prob.a = prob.p, prob.i = prob.p, munb.a = munb.p, munb.i = munb.p, lower.tail = TRUE) qgaitnbinom(p, size.p, prob.p = NULL, munb.p = NULL, alt.mix = NULL, alt.mlm = NULL, inf.mix = NULL, inf.mlm = NULL, truncate = NULL, max.support = Inf, pobs.mix = 0, pobs.mlm = 0, pstr.mix = 0, pstr.mlm = 0, byrow.ai = FALSE, size.a = size.p, size.i = size.p, prob.a = prob.p, prob.i = prob.p, munb.a = munb.p, munb.i = munb.p) rgaitnbinom(n, size.p, prob.p = NULL, munb.p = NULL, alt.mix = NULL, alt.mlm = NULL, inf.mix = NULL, inf.mlm = NULL, truncate = NULL, max.support = Inf, pobs.mix = 0, pobs.mlm = 0, pstr.mix = 0, pstr.mlm = 0, byrow.ai = FALSE, size.a = size.p, size.i = size.p, prob.a = prob.p, prob.i = prob.p, munb.a = munb.p, munb.i = munb.p)
x, q, p, n, log, lower.tail |
Same meaning as in |
size.p, prob.p, munb.p |
Same meaning as in |
size.a, prob.a, munb.a |
See |
size.i, prob.i, munb.i |
See |
truncate, max.support |
See |
alt.mix, inf.mix |
See |
alt.mlm, inf.mlm |
See |
pobs.mlm, pstr.mlm, byrow.ai |
See |
pobs.mix, pstr.mix |
See |
deflation |
See |
These functions for the NBD are analogous to the Poisson,
hence most details have been put in
Gaitpois
.
The NBD has two possible parameterizations: one
involving a probability (argument begins with prob
)
and the other the mean (beginning with mu
).
Because NegBinomial
only allows
one of these arguments to be used, the functions here
have the same behaviour.
Four functions were moved from VGAM to VGAMdata;
they can be seen at Posnegbin
.
It is better to use
dgaitnbinom(x, size, munb.p = munb, truncate = 0)
instead of
dposnbinom(x, size, munb = munb)
, etc.
T. W. Yee.
size <- 10 ivec <- c(6, 14); avec <- c(8, 11); munb <- 10; xgrid <- 0:25 tvec <- 15; max.support <- 20; pobs.a <- 0.05; pstr.i <- 0.25 (ddd <- dgaitnbinom(xgrid, size, munb.p = munb, munb.a = munb + 5, truncate = tvec, max.support = max.support, pobs.mix = pobs.a, pobs.mlm = pobs.a, alt.mlm = avec, pstr.mix = pstr.i, inf.mix = ivec)) ## Not run: plot(xgrid, ddd, type = "n", ylab = "Probability", xlab = "x", main = "GAIT PNP Combo PMF---NB Parent") mylwd <- 1 abline(v = avec, col = 'blue', lwd = mylwd) abline(v = ivec, col = 'purple', lwd = mylwd) abline(v = tvec, col = 'tan', lwd = mylwd) abline(v = max.support, col = 'magenta', lwd = mylwd) abline(h = c(pobs.a, pstr.i, 0:1), col = 'gray', lty = "dashed") lines(xgrid, dnbinom(xgrid, size, mu = munb), col = 'gray', lty = 2) lines(xgrid, ddd, type = "h", col = "pink", lwd = 7) # GAIT PNP combo PMF points(xgrid[ddd == 0], ddd[ddd == 0], pch = 16) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.