These functions provide the density function, distribution function, quantile function, and random number generation for the Poisson-Inverse-Gamma (PInvGamma) Distribution
dpinvgamma(x, mu = 1, eta = 1, log = FALSE)ppinvgamma(q, mu = 1, eta = 1, lower.tail = TRUE, log.p = FALSE)
qpinvgamma(p, mu = 1, eta = 1)
rpinvgamma(n, mu = 1, eta = 1)
dpinvgamma gives the density, ppinvgamma gives the distribution function, qpinvgamma gives the quantile function, and rcom generates random deviates.
The length of the result is determined by n for rpinvgamma, and is the maximum of the lengths of the numerical arguments for the other functions.
numeric value or a vector of values.
numeric value or vector of mean values for the distribution (the values have to be greater than 0).
single value or vector of values for the scale parameter of the distribution (the values have to be greater than 0).
logical; if TRUE, probabilities p are given as log(p).
quantile or a vector of quantiles.
logical; if TRUE, probabilities p are \(P[X\leq x]\) otherwise, \(P[X>x]\).
logical; if TRUE, probabilities p are given as log(p).
probability or a vector of probabilities.
the number of random numbers to generate.
dpinvgamma computes the density (PDF) of the Poisson-Inverse-Gamma
Distribution.
ppinvgamma computes the CDF of the Poisson-Inverse-Gama Distribution.
qpinvgamma computes the quantile function of the
Poisson-Inverse-Gamma Distribution.
rpinvgamma generates random numbers from the Poisson-Inverse-Gamma
Distribution.
The compound Probability Mass Function (PMF) for the Poisson-Inverse-Gamma distribution is: $$ f(x|\eta,\mu)=\frac{2\left(\mu\left(\frac{1}{\eta}+1\right)\right)^{ \frac{x+\frac{1}{eta}+2}{2}}}{x!\Gamma\left(\frac{1}{\eta}+2\right)} K_{x-\frac{1}{\eta}-2}\left(2\sqrt{\mu\left(\frac{1}{\eta}+1\right)}\right) $$
Where \(\eta\) is a shape parameter with the restriction that \(\eta>0\), \(\mu>0\) is the mean value, \(y\) is a non-negative integer, and \(K_i(z)\) is the modified Bessel function of the second kind. This formulation uses the mean directly.
The variance of the distribution is: $$\sigma^2=\mu+\eta\mu^2$$
dpinvgamma(1, mu=0.75, eta=1)
ppinvgamma(c(0,1,2,3,5,7,9,10), mu=0.75, eta=3)
qpinvgamma(c(0.1,0.3,0.5,0.9,0.95), mu=0.75, eta=0.5)
rpinvgamma(30, mu=0.75, eta=1.5)
Run the code above in your browser using DataLab