Description Usage Arguments Details See Also Examples
Probability mass function and random generation for the gamma-Poisson distribution.
1 2 3 4 5 |
x, q |
vector of quantiles. |
shape, scale |
shape and scale parameters. Must be positive, scale strictly. |
rate |
an alternative way to specify the scale. |
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]. |
n |
number of observations. If |
Gamma-Poisson distribution arises as a continuous mixture of Poisson distributions, where the mixing distribution of the Poisson rate λ is a gamma distribution. When X ~ Poisson(λ) and λ ~ Gamma(α, β), then X ~ Gamma-Poisson(α, β).
Probability mass function
f(x) = Γ(α+x) / (x!*Γ(α)) * (β/(1+β))^x * (1-β/(1+β))^α
Cumulative distribution function is calculated using recursive algorithm that employs the fact that Γ(x) = (x - 1)!. This enables re-writing probability mass function as
f(x) = ((α+x-1)!)/(x!*Γ(α))*(β/(1+β))^x*(1-β/(1+β))^α
what makes recursive updating from x to x+1 easy using the properties of factorials
f(x+1) = ((α+x-1)!*(α+x))/(x!*(x+1)*Γ(α))*(β/(1+β))^x*(β/(1+β))*(1-β/(1+β))^α
and let's us efficiently calculate cumulative distribution function as a sum of probability mass functions
F(x) = f(0)+...+f(x)
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.