
Density,
distribution function,
quantile function and random generation
for the one-inflated positive
Poisson distribution with parameter pstr1
.
doipospois(x, lambda, pstr1 = 0, log = FALSE)
poipospois(q, lambda, pstr1 = 0)
qoipospois(p, lambda, pstr1 = 0)
roipospois(n, lambda, pstr1 = 0)
doipospois
gives the density,
poipospois
gives the distribution function,
qoipospois
gives the quantile function, and
roipospois
generates random deviates.
Same as Pospois
.
Vector of positive means.
Probability of a structural one
(i.e., ignoring the positive Poisson distribution),
called
Logical. Return the logarithm of the answer?
T. W. Yee
The probability function of
Pospois
,
oapospoisson
,
oipospoisson
,
otpospoisson
,
pospoisson
,
dpois
,
poissonff
.
lambda <- 3; pstr1 <- 0.2; x <- (-1):7
(ii <- doipospois(x, lambda, pstr1 = pstr1))
table(roipospois(100, lambda, pstr1 = pstr1))
round(doipospois(1:10, lambda, pstr1 = pstr1) * 100) # Similar?
if (FALSE) x <- 0:10
par(mfrow = c(2, 1)) # One-Inflated Positive Poisson
barplot(rbind(doipospois(x, lambda, pstr1 = pstr1),
dpospois(x, lambda)),
beside = TRUE, col = c("blue", "orange"),
main = paste0("OIPP(", lambda, ", pstr1 = ", pstr1,
") (blue) vs PosPoisson(", lambda, ") (orange)"),
names.arg = as.character(x))
# 0-deflated Pos Poisson:
deflat.limit <- -lambda / (expm1(lambda) - lambda)
newpstr1 <- round(deflat.limit, 3) + 0.001 # Near the boundary
barplot(rbind(doipospois(x, lambda, pstr1 = newpstr1),
dpospois(x, lambda)),
beside = TRUE, col = c("blue","orange"),
main = paste0("ODPP(", lambda, ", pstr1 = ", newpstr1,
") (blue) vs PosPoisson(", lambda, ") (orange)"),
names.arg = as.character(x))
Run the code above in your browser using DataLab