Density, distribution function, quantile function and random generation for the exponential poisson distribution.

dexppois(x, rate = 1, shape, log = FALSE)
pexppois(q, rate = 1, shape, lower.tail = TRUE, log.p = FALSE)
qexppois(p, rate = 1, shape, lower.tail = TRUE, log.p = FALSE)
rexppois(n, rate = 1, shape)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1 then the length is taken to be the number required.

shape, rate

positive parameters.

log

Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in pnorm or qnorm.

Value

dexppois gives the density, pexppois gives the distribution function, qexppois gives the quantile function, and rexppois generates random deviates.

Author

Kai Huang and J. G. Lauder

Details

See exppoisson, the VGAM family function for estimating the parameters, for the formula of the probability density function and other details.

See also

Examples

if (FALSE)  rate <- 2; shape <- 0.5; nn <- 201
x <- seq(-0.05, 1.05, len = nn)
plot(x, dexppois(x, rate = rate, shape), type = "l", las = 1, ylim = c(0, 3),
     ylab = paste("fexppoisson(rate = ", rate, ", shape = ", shape, ")"),
     col = "blue", cex.main = 0.8,
     main = "Blue is the density, orange the cumulative distribution function",
     sub = "Purple lines are the 10,20,...,90 percentiles")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'y' in selecting a method for function 'plot': object 'rate' not found
lines(x, pexppois(x, rate = rate, shape), col = "orange")
#> Error: object 'rate' not found
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qexppois(probs, rate = rate, shape)
#> Error: object 'rate' not found
lines(Q, dexppois(Q, rate = rate, shape), col = "purple", lty = 3, type = "h")
#> Error: object 'Q' not found
lines(Q, pexppois(Q, rate = rate, shape), col = "purple", lty = 3, type = "h")
#> Error: object 'Q' not found
abline(h = probs, col = "purple", lty = 3); abline(h = 0, col = "gray50")
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
max(abs(pexppois(Q, rate = rate, shape) - probs))  # Should be 0
#> Error: object 'rate' not found
 # \dontrun{}