R/izip_distribution.R
iZIP_Distribution.Rd
Density, distribution function, quantile function and random generation for the
interpretable Zero-Inflated Poisson with parameter mu
and nu
dizip(x, mu, nu, pi, ref.lambda = 1, log.p = FALSE) pizip(q, mu, nu, pi, ref.lambda = 1, lower.tail = TRUE, log.p = FALSE) qizip(p, mu, nu, pi, ref.lambda = 1, lower.tail = TRUE, log.p = FALSE) rizip(n, mu, nu, pi, ref.lambda = 1)
x, q | vector of quantiles |
---|---|
mu, nu | mean and baseline zero inflation odds parameters. Must be strictly positive. |
pi | an alternative way than nu to parametrized the distribution. Must be between 0 and 1. |
ref.lambda | numeric; Baseline Poisson rate. Default is 1. |
log.p | logical; if |
lower.tail | logical; if |
p | vector of probabilities |
n | number of observations. If |
dizip
gives the density, pizip
gives the distribution function, qizip
gives the quantile function, and rizip
generates random deviates.
Invalid arguments will result in return value NaN
, with a warning.
The length of the results is determined by n
for rizip
, and is the maximum
of the lengths of the numerical arguments for the other functions.
The numerical arguments other than n
are recycled to the length of the results.
Only the first argument of the logical arguments are used.
dizip(0:5, mu = 2, nu = 1.2)#> [1] 0.27093249 0.16040178 0.20236454 0.17020347 0.10736523 0.05418123pizip(5, mu = 2, nu = 1.2)#> [1] 0.9654487p <- (1:9) / 10 qizip(p, mu = 2, nu = 1)#> [1] 0 0 1 1 2 2 3 3 4rizip(10, mu = 2, nu = 4)#> [1] 0 4 2 0 0 1 2 0 3 4