Learn R Programming

frmqa (version 0.1-5)

pgig: Accurate Evaluation of Tail Probabilities of the Generalized Inverse Gaussian Distribution

Description

Evaluates analytical formulae for distribution functions of the generalized inverse Gaussian distribution (GIG) by calling function besselK_inc_err.

Usage

pgig(q, lambda, chi, psi, lower.tail = TRUE, bit = 200)

Arguments

Details

The GIG is given by $$GIG(w|\lambda, \chi, \psi) = \frac{(\psi/\chi)^{\lambda/2}}{2 K_{\lambda} (\sqrt{\chi\psi})}\,e^{-\left(\chi w^{-1} \,+\, \psi w \right)/2}\, w^{\lambda - 1} \qquad w >0.$$ This distribution has been used in hydrology, reliability analysis, extreme events modelling in financial risk management, and as the mixing distribution to form the family of generalized hyperbolic distributions in statistics.

References

Barndorff-Nielsen, O. E (1977) Exponentially decreasing distributions for the logarithm of particle size. Proceedings of the Royal Society of London. Series {A}, 353, 401--419. Olver, F.W.J., Lozier, D.W., Boisver, R.F. and Clark, C.W (2010) Handbook of Mathematical Functions. New York: National Institute of Standards and Technology, and Cambridge University Press. Tran, T. T., Yee, W.T. and Tee, J.G (2012) Formulae for the Extended Laplace Integral and Their Statistical Applications. Working Paper. Watson, G.N (1931) A Treatise on the Theory of Bessel Functions and Their Applications to Physics. London: MacMillan and Co.

See Also

CalIncLapInt, gamma_inc_err

Examples

Run this code
## Accuracy tests
q <- 1
chi <- 3
psi <- 15
lambda <- 5/2
lowerTail <- sapply(lambda, function(w.)
  pgig(q, chi, psi, lambda = w., lower.tail = TRUE, 200))
upperTail <- sapply(lambda, function(w.)
  pgig(q, chi, psi, lambda = w., lower.tail = FALSE, 200))
## sum of two parts equals 1
(lowerTail + upperTail)

Run the code above in your browser using DataLab