Generally Altered, Inflated and Truncated and Deflated Zeta Distribution
gaitdzetaUC.RdDensity, distribution function, quantile function and random generation for the generally altered, inflated, truncated and deflated zeta 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
dgaitdzeta(x, shape.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,
shape.a = shape.p, shape.i = shape.p, shape.d = shape.p,
log = FALSE)
pgaitdzeta(q, shape.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,
shape.a = shape.p, shape.i = shape.p, shape.d = shape.p,
lower.tail = TRUE)
qgaitdzeta(p, shape.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,
shape.a = shape.p, shape.i = shape.p, shape.d = shape.p)
rgaitdzeta(n, shape.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,
shape.a = shape.p, shape.i = shape.p, shape.d = shape.p)Arguments
- x, q, p, n, log, lower.tail
Same meaning as in
dzeta.- shape.p, shape.a, shape.i, shape.d
Same meaning as
shapefordzeta, i.e., for an ordinary zeta distribution. SeeGaitdpoisfor generic information.- truncate, max.support
See
Gaitdpoisfor generic information.- a.mix, i.mix, d.mix
See
Gaitdpoisfor generic information.- a.mlm, i.mlm, d.mlm
See
Gaitdpoisfor generic information.- pobs.mlm, pstr.mlm, pdip.mlm, byrow.aid
See
Gaitdpoisfor generic information.- pobs.mix, pstr.mix, pdip.mix
See
Gaitdpoisfor generic information.
Details
These functions for the zeta distribution are analogous to
the Poisson, hence most details have been put in
Gaitdpois.
These functions do what
Oazeta,
Oizeta,
Otzeta
collectively did plus much more.
Warning
See Gaitdpois about the dangers
of too much inflation and/or deflation on
GAITD PMFs, and the difficulties detecting such.
Value
dgaitdzeta gives the density,
pgaitdzeta gives the distribution function,
qgaitdzeta gives the quantile function, and
rgaitdzeta generates random deviates.
The default values of the arguments correspond to ordinary
dzeta,
pzeta,
qzeta,
rzeta
respectively.
See also
gaitdzeta,
Gaitdpois,
dgaitdplot,
multinomial,
Oazeta,
Oizeta,
Otzeta.
Examples
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 <- dgaitdzeta(xgrid, shape, truncate = tvec,
max.support = max.support, pobs.mix = pobs.a,
a.mix = avec, pstr.mix = pstr.i, i.mix = ivec))
#> [1] 0.0000000000 0.4674039610 0.2647391363 0.0548663339 0.0313094476
#> [6] 0.0202628664 0.0839192325 0.0105135942 0.0081033932 0.0064404987
#> [11] 0.0114769540 0.0043548846 0.0036752675 0.0031441471 0.0160807675
#> [16] 0.0000000000 0.0020972897 0.0018634468 0.0016669056 0.0015001092
#> [21] 0.0013573252 0.0012341410 0.0011271148 0.0010335300 0.0009512189
#> [26] 0.0008784345 0.0000000000 0.0000000000 0.0000000000 0.0000000000
if (FALSE) plot(xgrid, ddd, type = "n", ylab = "Probability",
xlab = "x", main = "GAIT PMF---Zeta Parent")
mylwd <- 0.5
abline(v = avec, col = 'blue', lwd = mylwd)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
abline(v = ivec, col = 'purple', lwd = mylwd)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
abline(v = tvec, col = 'tan', lwd = mylwd)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
abline(v = max.support, col = 'magenta', lwd = mylwd)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
abline(h = c(pobs.a, pstr.i, 0:1), col = 'gray', lty = "dashed")
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
lines(xgrid, dzeta(xgrid, shape), col='gray', lty="dashed") # f_{\pi}
#> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet
lines(xgrid, ddd, type = "h", col = "pink", lwd = 3) # GAIT PMF
#> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet
points(xgrid[ddd == 0], ddd[ddd == 0], pch = 16, col = 'tan', cex = 2)
#> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet
# \dontrun{}