hpois {countreg}R Documentation

The Hurdle Poisson Distribution

Description

Density, distribution function, quantile function, random generation, score function, hessian, mean, and, variance for the (zero-)hurdle Poisson distribution with parameters mu (= mean of the underlying Poisson distribution) and hurdle crossing probability pi (i.e., 1 - pi is the probability for observed zeros).

Usage

dhpois(x, lambda, pi, log = FALSE)
phpois(q, lambda, pi, lower.tail = TRUE, log.p = FALSE)
qhpois(p, lambda, pi, lower.tail = TRUE, log.p = FALSE)
rhpois(n, lambda, pi)
shpois(x, lambda, pi, parameter = c("lambda", "pi"), drop = TRUE)
hhpois(x, lambda, pi, parameter = c("lambda", "pi"), drop = TRUE)
mean_hpois(lambda, pi, drop = TRUE)
var_hpois(lambda, pi, drop = TRUE)

Arguments

x

vector of (positive integer) quantiles.

q

vector of quantiles.

p

vector of probabilities.

n

number of random values to return.

lambda

vector of non-negative means of the underlying Poisson distribution.

pi

vector of hurdle crossing probabilities (i.e., 1 - pi is the probability for observed zeros).

log, log.p

logical. If TRUE, probabilities p are given as log(p).

lower.tail

logical. If TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].

parameter

character. Should the derivative with respect to "lambda" and/or "pi" be computed?

drop

logical. Should the result be a matrix (drop = FALSE) or should the dimension be dropped (drop = TRUE, the default)?

Details

The underlying Poisson distribution has density

f(x) = λ^x exp(-λ)/x!

for x = 0, 1, 2, …. The hurdle density is then simply obtained as

g(x) = π f(x)/(1 - f(0))

for x = 1, 2, … and g(0) = 1 - π, respectively.

Value

dhpois gives the (log) density, phpois gives the (log) distribution function, qhpois gives the quantile function, rhpois generates random deviates, and shpois gives the score function (= derivative of the log-density with respect to lambda and/or pi). hhpois gives the hessian (= 2nd derivative of the log-density with respect to lambda and/or pi). mean_hpois and var_hpois give the mean and the variance, respectively.

See Also

dpois, hurdle


[Package countreg version 0.2-1 Index]