One-Inflated Zeta Distribution
Density, distribution function, quantile function and random generation
for the one-inflated
zeta distribution with parameter pstr1
.
doizeta(x, shape, pstr1 = 0, log = FALSE) poizeta(q, shape, pstr1 = 0) qoizeta(p, shape, pstr1 = 0) roizeta(n, shape, pstr1 = 0)
The probability function of Y is 1 with probability phi, and Zeta(shape) with probability 1-phi. Thus
P(Y=1) = phi + (1-phi) * P(W=1)
where W is distributed as a zeta(shape) random variable.
doizeta
gives the density,
poizeta
gives the distribution function,
qoizeta
gives the quantile function, and
roizeta
generates random deviates.
The argument pstr1
is recycled to the required length, and
usually has values which lie in the interval [0,1].
These functions actually allow for the zero-deflated
zeta distribution. Here, pstr1
is also permitted
to lie in the interval [-dzeta(1, shape) / (1 - dzeta(1, shape)), 0]
.
The resulting probability of a unit count is less than
the nominal zeta value, and the use of pstr1
to
stand for the probability of a structural 1 loses its
meaning.
When pstr1
equals -dzeta(1, shape) / (1 - dzeta(1, shape))
this corresponds to the 1-truncated zeta distribution.
T. W. Yee
shape <- 1.5; pstr1 <- 0.3; x <- (-1):7 (ii <- doizeta(x, shape, pstr1 = pstr1)) max(abs(poizeta(1:200, shape) - cumsum(1/(1:200)^(1+shape)) / zeta(shape+1))) # Should be 0 ## Not run: x <- 0:10 par(mfrow = c(2, 1)) # One-Inflated zeta barplot(rbind(doizeta(x, shape, pstr1 = pstr1), dzeta(x, shape)), beside = TRUE, col = c("blue", "orange"), main = paste("OIZeta(", shape, ", pstr1 = ", pstr1, ") (blue) vs", " Zeta(", shape, ") (orange)", sep = ""), names.arg = as.character(x)) deflat.limit <- -dzeta(1, shape) / pzeta(1, shape, lower.tail = FALSE) newpstr1 <- round(deflat.limit, 3) + 0.001 # Inside but near the boundary barplot(rbind(doizeta(x, shape, pstr1 = newpstr1), dzeta(x, shape)), beside = TRUE, col = c("blue","orange"), main = paste("ODZeta(", shape, ", pstr1 = ", newpstr1, ") (blue) vs", " Zeta(", shape, ") (orange)", sep = ""), names.arg = as.character(x)) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.