| PoissonInverseGamma | R Documentation |
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)
x |
numeric value or a vector of values. |
mu |
numeric value or vector of mean values for the distribution (the values have to be greater than 0). |
eta |
single value or vector of values for the scale parameter of the distribution (the values have to be greater than 0). |
log |
logical; if TRUE, probabilities p are given as log(p). |
q |
quantile or a vector of quantiles. |
lower.tail |
logical; if TRUE, probabilities p are |
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. |
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 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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.