Density, distribution function, quantile function and random generation
for the zero-altered geometric distribution with parameter pobs0
.
dzageom(x, prob, pobs0 = 0, log = FALSE)
pzageom(q, prob, pobs0 = 0)
qzageom(p, prob, pobs0 = 0)
rzageom(n, prob, pobs0 = 0)
vector of quantiles.
vector of probabilities.
number of observations.
If length(n) > 1
then the length is taken to be the number required.
Parameters from the ordinary geometric distribution
(see dgeom
).
Probability of (an observed) zero, called pobs0 = 0
corresponds
to the response having a positive geometric distribution.
dzageom
gives the density and
pzageom
gives the distribution function,
qzageom
gives the quantile function, and
rzageom
generates random deviates.
The probability function of pobs0
,
else a positive
geometric(prob)
distribution.
# NOT RUN {
prob <- 0.35; pobs0 <- 0.05; x <- (-1):7
dzageom(x, prob = prob, pobs0 = pobs0)
table(rzageom(100, prob = prob, pobs0 = pobs0))
# }
# NOT RUN {
x <- 0:10
barplot(rbind(dzageom(x, prob = prob, pobs0 = pobs0),
dgeom(x, prob = prob)),
beside = TRUE, col = c("blue", "orange"), cex.main = 0.7, las = 1,
ylab = "Probability", names.arg = as.character(x),
main = paste("ZAG(prob = ", prob, ", pobs0 = ", pobs0,
") [blue] vs", " Geometric(prob = ", prob,
") [orange] densities", sep = ""))
# }
Run the code above in your browser using DataLab