Learn R Programming

VGAM (version 1.1-9)

Gaitdnbinom: Generally Altered, Inflated, Truncated and Deflated Negative Binomial Distribution

Description

Density, distribution function, quantile function and random generation for the generally altered, inflated, truncated and deflated negative binomial (GAITD-NB) 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.

Usage

dgaitdnbinom(x, size.p, munb.p,
             a.mix = NULL, a.mlm = NULL,
             i.mix = NULL, i.mlm = NULL,
             d.mix = NULL, d.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix = 0, pobs.mlm = 0,
             pstr.mix = 0, pstr.mlm = 0,
             pdip.mix = 0, pdip.mlm = 0, byrow.aid = FALSE,
             size.a = size.p, size.i = size.p, size.d = size.p,
             munb.a = munb.p, munb.i = munb.p, munb.d = munb.p,
             log = FALSE)
pgaitdnbinom(q, size.p, munb.p,
             a.mix = NULL, a.mlm = NULL,
             i.mix = NULL, i.mlm = NULL,
             d.mix = NULL, d.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix = 0, pobs.mlm = 0,
             pstr.mix = 0, pstr.mlm = 0,
             pdip.mix = 0, pdip.mlm = 0, byrow.aid = FALSE,
             size.a = size.p, size.i = size.p, size.d = size.p,
             munb.a = munb.p, munb.i = munb.p, munb.d = munb.p,
             lower.tail = TRUE)
qgaitdnbinom(p, size.p, munb.p,
             a.mix = NULL, a.mlm = NULL,
             i.mix = NULL, i.mlm = NULL,
             d.mix = NULL, d.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix = 0, pobs.mlm = 0,
             pstr.mix = 0, pstr.mlm = 0,
             pdip.mix = 0, pdip.mlm = 0, byrow.aid = FALSE,
             size.a = size.p, size.i = size.p, size.d = size.p,
             munb.a = munb.p, munb.i = munb.p, munb.d = munb.p)
rgaitdnbinom(n, size.p, munb.p,
             a.mix = NULL, a.mlm = NULL,
             i.mix = NULL, i.mlm = NULL,
             d.mix = NULL, d.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix = 0, pobs.mlm = 0,
             pstr.mix = 0, pstr.mlm = 0,
             pdip.mix = 0, pdip.mlm = 0, byrow.aid = FALSE,
             size.a = size.p, size.i = size.p, size.d = size.p,
             munb.a = munb.p, munb.i = munb.p, munb.d = munb.p)

Value

dgaitdnbinom gives the density,

pgaitdnbinom gives the distribution function,

qgaitdnbinom gives the quantile function, and

rgaitdnbinom generates random deviates. The default values of the arguments correspond to ordinary

dnbinom,

pnbinom,

qnbinom,

rnbinom

respectively.

Arguments

x, q, p, n, log, lower.tail

Same meaning as in rnbinom.

size.p, munb.p

Same meaning as in rnbinom. See Gaitdpois for generic information.

size.a, munb.a

See Gaitdpois for generic information.

size.i, munb.i

See Gaitdpois for generic information.

size.d, munb.d

See Gaitdpois for generic information.

truncate, max.support

See Gaitdpois for generic information.

a.mix, i.mix, d.mix

See Gaitdpois for generic information.

a.mlm, i.mlm, d.mlm

See Gaitdpois for generic information.

pobs.mlm, pstr.mlm, byrow.aid

See Gaitdpois for generic information.

pobs.mix, pstr.mix

See Gaitdpois for generic information.

pdip.mix, pdip.mlm

See Gaitdpois for generic information.

Warning

See Gaitdpois about the dangers of too much inflation and/or deflation on GAITD PMFs, and the difficulties detecting such.

Author

T. W. Yee.

Details

These functions for the NBD are analogous to the Poisson, hence most details have been put in Gaitdpois. The NBD has two possible parameterizations: one involving a probability (argument begins with prob) and the other the mean (beginning with mu). Only the latter is supported here.

For now, arguments such as prob.p and prob.a are no longer supported. That's because mu is more likely to be used by most statisticians than prob; see dnbinom.

See Also

gaitdnbinomial, Gaitdpois, multinomial, Gaitdbinom, Gaitdlog, Gaitdzeta.

Examples

Run this code
size <- 10; xgrid <- 0:25
ivec <- c(5, 6, 10, 14); avec <- c(8, 11); munb <- 10
tvec <- 15; pobs.a <- 0.05; pstr.i <- 0.25
dvec <- 13; pdip.mlm <- 0.03; pobs.mlm <- 0.05
(ddd <- dgaitdnbinom(xgrid, size, munb.p = munb, munb.a = munb + 5,
   truncate = tvec, pobs.mix = pobs.a,
   pdip.mlm = pdip.mlm, d.mlm = dvec,
   pobs.mlm = pobs.a, a.mlm = avec,
   pstr.mix = pstr.i, i.mix = ivec))
if (FALSE) dgaitdplot(c(size, munb), fam = "nbinom",
  ylab = "Probability", xlab = "x", xlim = c(0, 25),
  truncate = tvec, pobs.mix = pobs.mix,
  pobs.mlm = pobs.mlm, a.mlm = avec, all.lwd = 3,
  pdip.mlm = pdip.mlm, d.mlm = dvec,
  pstr.mix = pstr.i, i.mix = ivec, deflation = TRUE,
  main = "GAITD Combo PMF---NB Parent")   

Run the code above in your browser using DataLab