rZIzeta {fitPS} | R Documentation |
Generate zero inflated zeta random variates
Description
Generate zero inflated zeta random variates
Usage
rZIzeta(n, pi = 0.5, shape = 1, offset = 0)
rzizeta(n, pi = 0.5, shape = 1, offset = 0)
rzizeta(n, pi = 0.5, shape = 1, offset = 0)
Arguments
n |
the number of observations. |
pi |
the mixing parameter for the zero-inflated zeta model—must be in (0, 1). |
shape |
the shape parameter for the zero-inflated zeta. Must be greater than zero. |
offset |
the zeta distribution returns random variates that are greater
than, or equal to one. If the offset is greater than 0, then the
distribution is anchored on (has minimum value of) |
Details
Technically this function returns values from the one-inflated zeta
distribution. However, if offset
is greater than zero (and typically
we expect it to be 1), then the minimium random variate value is 1 -
offset
. We chose the name "zero-inflated zeta" as more people are familiar
with zero-inflated models.
Value
a vector of random variates from a zero-inflated zeta model
Examples
data(Psurveys)
roux = Psurveys$roux
fit.zi = fitZIDist(roux)
x = rZIzeta(n = sum(roux$data$rn), pi = fit.zi$pi, shape = fit.zi$shape)
table(x)