
Poisson-Lindley-Gamma (Negative Binomial-Lindley) Distribution
NegativeBinomialLindley.RdThese functions provide density, distribution function, quantile function, and random number generation for the Poisson-Lindley-Gamma (PLG) Distribution
Usage
dplindGamma(
x,
mean = 1,
theta = 1,
alpha = 1,
log = FALSE,
rel.tol = 1e-08,
subdivisions = 200L
)
pplindGamma(
q,
mean = 1,
theta = 1,
alpha = 1,
lower.tail = TRUE,
log.p = FALSE,
rel.tol = 1e-08,
subdivisions = 200L
)
qplindGamma(p, mean = 1, theta = 1, alpha = 1)
rplindGamma(n, mean = 1, theta = 1, alpha = 1)Arguments
- x
numeric value or a vector of values.
- mean
numeric value or vector of mean values for the distribution (the values have to be greater than 0).
- theta
single value or vector of values for the theta parameter of the distribution (the values have to be greater than 0).
- alpha
single value or vector of values for the
alphaparameter of the gamma distribution in the special case that the mean = 1 and the variance =alpha(the values foralphahave to be greater than 0).- log
logical; if TRUE, probabilities p are given as log(p).
- rel.tol
Relative numerical integration tolerance; default 1e-8.
- subdivisions
Maximum subintervals per component-side integral.
- q
quantile or a vector of quantiles.
- lower.tail
logical; if TRUE, probabilities p are \(P[X\leq x]\) otherwise, \(P[X>x]\).
- log.p
logical; if TRUE, probabilities p are given as log(p).
- p
probability or a vector of probabilities.
- n
the number of random numbers to generate.
Value
dplindGamma gives the density, pplindGamma gives the distribution function, qplindGamma gives the quantile function, and rplindGamma generates random deviates.
The length of the result is determined by n for rplindGamma, and is the maximum of the lengths of the numerical arguments for the other functions.
Details
The Poisson-Lindley-Gamma is a count distribution that captures high densities for small integer values and provides flexibility for heavier tails.
dplindGamma computes the density (PDF) of the
Poisson-Lindley-Gamma Distribution.
pplindGamma computes the CDF of the Poisson-Lindley-Gamma
Distribution.
qplindGamma computes the quantile function of the
Poisson-Lindley-Gamma Distribution.
rplindGamma generates random numbers from the
Poisson-Lindley-Gamma Distribution.
The compound Probability Mass Function (PMF) for the Poisson-Lindley-Gamma (PLG) distribution is: $$ f(x|\mu,\theta,\alpha)= \frac{ (\theta+2)^2\Gamma(x+1/\alpha) }{ \alpha\mu^2(\theta+1)^3\Gamma(1/\alpha) } \left( \frac{\mu\theta(\theta+1)}{\theta+2} U\left( x+1,2-1/\alpha,\frac{1/\alpha(\theta+2)}{\mu(\theta+1)} \right) + 1/\alpha(x+1) U\left( x+2,3-1/\alpha,\frac{1/\alpha(\theta+2)}{\mu(\theta+1)} \right) \right) $$
Where \(\theta\) is a distribution parameter from the Poisson-Lindley distribution with the restrictions that \(\theta>0\), \(\alpha\) is a parameter for the gamma distribution with the restriction \(\alpha>0\), \(\mu\) is the mean value, and \(x\) is a non-negative integer, and $$U(a,b,z)$$ is the Tricomi’s confluent hypergeometric function to - also known as the confluent hypergeometric function of the second kind
The expected value of the distribution is: $$E[x]=\mu$$
The variance is: $$\sigma^2=\mu+\left(\left(1+\alpha\right)\left(2-\frac{2} {(\theta+2)^2}\right)-1\right)\mu^2$$
Examples
dplindGamma(0, mean=0.75, theta=7, alpha=2)
#> [1] 0.6987929
pplindGamma(c(0,1,2,3,5,7,9,10), mean=0.75, theta=3, alpha=0.5)
#> [1] 0.6124292 0.8264579 0.9149954 0.9556459 0.9861974 0.9951259 0.9981156
#> [8] 0.9987963
qplindGamma(c(0.1,0.3,0.5,0.9,0.95), mean=1.67, theta=0.5, alpha=0.5)
#> [1] 0 0 1 4 6
rplindGamma(30, mean=0.5, theta=0.5, alpha=2)
#> [1] 0 2 2 0 0 0 0 0 0 0 0 3 0 0 1 0 3 0 1 0 0 0 0 0 0 0 0 1 0 0