| zigeom | R Documentation |
Probability mass function, distribution function, and random generation for the zero-inflated geometric distribution.
dzigeom(x, prob, zeroprob = 0, log = FALSE)
pzigeom(q, prob, zeroprob = 0, lower.tail = TRUE, log.p = FALSE)
rzigeom(n, prob, zeroprob = 0)
x, q |
integer vector of counts |
prob |
probability of success in each trial, in (0,1] |
zeroprob |
zero-inflation probability between 0 and 1 |
log, log.p |
logical; return log-density if TRUE |
lower.tail |
logical; if |
n |
number of random values to return. |
This implementation allows for automatic differentiation with RTMB.
P(X=k;\,\pi,p_0) = p_0\,\mathbf{1}[k=0] + (1-p_0)\,P_{\mathrm{Geom}}(k;\,\pi),
where p_0 is zeroprob. The zeros are a mixture of structural zeros
and zeros generated by the geometric itself, so zeroprob is not the
probability of observing a zero; see hgeom for the hurdle version,
where it is.
dzigeom gives the probability mass function, pzigeom gives the distribution function, and rzigeom generates random deviates.
ztgeom, hgeom, zinbinom, zipois
set.seed(123)
x <- rzigeom(5, prob = 0.3, zeroprob = 0.4)
d <- dzigeom(x, prob = 0.3, zeroprob = 0.4)
p <- pzigeom(x, prob = 0.3, zeroprob = 0.4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.