Density, distribution function, quantile function and random generation for the generally--altered, --inflated and --truncated logarithmic 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--Log(shape.p)--Log(shape.a)--MLM--Log(shape.i)--MLM, and it is also known as the GAIT-Log PNP combo.
dgaitlog(x, shape.p, 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,
shape.a = shape.p, shape.i = shape.p, deflation = FALSE,
log = FALSE)
pgaitlog(q, shape.p, 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,
shape.a = shape.p, shape.i = shape.p, lower.tail = TRUE)
qgaitlog(p, shape.p, 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,
shape.a = shape.p, shape.i = shape.p)
rgaitlog(n, shape.p, 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,
shape.a = shape.p, shape.i = shape.p)
Same meaning as in dlog
.
See Gaitpois
for generic information.
See Gaitpois
for generic information.
See Gaitpois
for generic information.
See Gaitpois
for generic information.
See Gaitpois
for generic information.
See Gaitpois
for generic information.
dgaitlog
gives the density,
pgaitlog
gives the distribution function,
qgaitlog
gives the quantile function, and
rgaitlog
generates random deviates.
The default values of the arguments correspond to ordinary
dlog
,
plog
,
qlog
,
rlog
respectively.
These functions for the logarithmic distribution
are analogous to the Poisson,
hence most details have been put in
Gaitpois
.
These functions do what
Oalog
,
Oilog
,
Otlog
collectively did plus much more.
# NOT RUN {
ivec <- c(2, 10); avec <- ivec + 4; shape <- 0.95; xgrid <- 0:29
tvec <- 15; max.support <- 25; pobs.a <- 0.10; pstr.i <- 0.15
(ddd <- dgaitlog(xgrid, shape, truncate = tvec,
max.support = max.support, pobs.mix = pobs.a,
alt.mix = avec, pstr.mix = pstr.i, inf.mix = ivec))
# }
# NOT RUN {
plot(xgrid, ddd, type = "n", ylab = "Probability", xlab = "x",
main = "GAIT PMF---Logarithmic Parent")
mylwd <- 0.5
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, dlog(xgrid, shape), col = 'gray', lty = "dashed") # f_{\pi}
lines(xgrid, ddd, type = "h", col = "pink", lwd = 3) # GAIT PMF
points(xgrid[ddd == 0], ddd[ddd == 0], pch = 16, col = 'tan', cex = 2)
# }
Run the code above in your browser using DataLab