
Density, distribution function, quantile function and random generation for the generally-altered, -inflated and -truncated negative binomial distribution, based on the multinomial logit model (MLM). This distribution is sometimes abbreviated as GAIT--NB--MLM--MLM.
dgaitnbinom.mlm(x, size, prob = NULL, munb = NULL, alter = NULL,
inflate = NULL, truncate = NULL, max.support = Inf,
pobs.a = 0, pstr.i = 0, byrow.arg = FALSE,
log.arg = FALSE)
pgaitnbinom.mlm(q, size, prob = NULL, munb = NULL, alter = NULL,
inflate = NULL, truncate = NULL, max.support = Inf,
pobs.a = 0, pstr.i = 0, byrow.arg = FALSE)
qgaitnbinom.mlm(p, size, prob = NULL, munb = NULL, alter = NULL,
inflate = NULL, truncate = NULL, max.support = Inf,
pobs.a = 0, pstr.i = 0, byrow.arg = FALSE)
rgaitnbinom.mlm(n, size, prob = NULL, munb = NULL, alter = NULL,
inflate = NULL, truncate = NULL, max.support = Inf,
pobs.a = 0, pstr.i = 0, byrow.arg = FALSE)
Same meaning as in NegBinomial
.
Same meaning as in NegBinomial
,
i.e., for an ordinary negative binomial distribution.
Argument mu
has been renamed to munb
to emphasize that
it refers to the negative binomial mean.
Only one of prob
and munb
should be specified.
Short vectors are recycled.
Same as in Gaitpois.mlm
.
Same as in Gaitpois.mlm
.
Same as in Gaitpois.mlm
.
dgaitnbinom.mlm
gives the density (PMF),
pgaitnbinom.mlm
gives the distribution function,
qgaitnbinom.mlm
gives the quantile function, and
rgaitnbinom.mlm
generates random deviates.
The default values of the arguments correspond to ordinary
dnegbin
,
pnegbin
,
qnegbin
,
rnegbin
respectively.
Largely the same as Gaitpois.mlm
except a
negative binomial distribution replaces the Poisson distribution.
Special cases of these functions include
dposnegbin
,
dzanegbin
,
dzinegbin
,
pposnegbin
,
pzanegbin
,
pzinegbin
,
qposnegbin
,
qzanegbin
,
qzinegbin
,
rposnegbin
,
rzanegbin
,
rzinegbin
corresponding to the special value 0.
However, now arguments alter
, inflate
and truncate
have been supplied in one function.
gatnbinomial.mlm
,
Gaitpois.mlm
,
NegBinomial
.
# NOT RUN {
avec <- c(5, 10) # Alter these (special) values
ivec <- c(15, 20) # Inflate these (special) values
tvec <- 0 # Truncate this (special) value
pobs.a <- c(0.1, 0.2)
pstr.i <- c(0.1, 0.1); size <- 3; munb <- 15; x <- 0:22
y <- rgaitnbinom.mlm(1000, size, munb = munb, alter = avec,
inflate = ivec, truncate = tvec, max.support = 20,
pstr.i = pstr.i, pobs.a = pobs.a, byrow = TRUE)
table(y)
(pmf <- dgaitnbinom.mlm(x, size, munb = munb, alter = avec,
inflate = ivec, truncate = tvec, max.support = 20,
pstr.i = pstr.i, pobs.a = pobs.a, byrow = TRUE))
# }
# NOT RUN {
plot(x, pmf, type = "h", col = "blue", las = 1,
main = "Heaped data that is also upper-truncated")
# }
Run the code above in your browser using DataLab