Learn R Programming

distributional (version 0.6.0)

dist_poisson_inverse_gaussian: The Poisson-Inverse Gaussian distribution

Description

[Stable]

The Poisson-Inverse Gaussian distribution is a compound Poisson distribution where the rate parameter follows an Inverse Gaussian distribution. It is useful for modeling overdispersed count data.

Usage

dist_poisson_inverse_gaussian(mean, shape)

Arguments

mean, shape

parameters. Must be strictly positive. Infinite values are supported.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_poisson_inverse_gaussian.html

In the following, let \(X\) be a Poisson-Inverse Gaussian random variable with parameters mean = \(\mu\) and shape = \(\phi\).

Support: \(\{0, 1, 2, 3, ...\}\)

Mean: \(\mu\)

Variance: \(\frac{\mu}{\phi}(\mu^2 + \phi)\)

Probability mass function (p.m.f):

$$ P(X = x) = \frac{e^{\phi}}{\sqrt{2\pi}} \left(\frac{\phi}{\mu^2}\right)^{x/2} \frac{1}{x!} \int_0^\infty u^{x-1/2} \exp\left(-\frac{\phi u}{2} - \frac{\phi}{2\mu^2 u}\right) du $$

for \(x = 0, 1, 2, \ldots\)

Cumulative distribution function (c.d.f):

$$ P(X \le x) = \sum_{k=0}^{\lfloor x \rfloor} P(X = k) $$

The c.d.f does not have a closed form and is approximated numerically.

Moment generating function (m.g.f):

$$ E(e^{tX}) = \exp\left\{\phi\left[1 - \sqrt{1 - \frac{2\mu^2}{\phi}(e^t - 1)}\right]\right\} $$

for \(t < -\log(1 + \phi/(2\mu^2))\)

See Also

actuar::PoissonInverseGaussian, actuar::dpoisinvgauss(), actuar::ppoisinvgauss(), actuar::qpoisinvgauss(), actuar::rpoisinvgauss()

Examples

Run this code
dist <- dist_poisson_inverse_gaussian(mean = rep(0.1, 3), shape = c(0.4, 0.8, 1))
dist

if (FALSE) { # requireNamespace("actuar", quietly = TRUE)
mean(dist)
variance(dist)
support(dist)
generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)
}

Run the code above in your browser using DataLab