pgig: Accurate Evaluation of Tail Probabilities of the Generalized...

Description Usage Arguments Details Note Author(s) References See Also Examples

View source: R/frmqa.R

Description

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

Usage

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

Arguments

q

Quantile, q > 0.

lambda

Parameter, λ = \pm(j + \frac{1}{2}) with j = 0, 1, 2, ….

chi

Parameter chi > 0.

psi

Parameter psi > 0.

lower.tail

Logical. P(W < w) is returned if TRUE.

bit

Precision bit. A positive integer greater or equal 100.

Details

The GIG is given by

GIG(w|λ, χ, ψ) = \frac{(ψ/χ)^{λ/2}}{2 K_{λ} (√{χψ})}\,e^{-≤ft(χ w^{-1} \,+\, ψ w \right)/2}\, w^{λ - 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.

Note

This function allows for accurate evaluation of distribution functions (c.d.f and c.c.d.f) of the family of GIG distributions with λ = \pm(j + \frac{1}{2}). Currently, only c.d.f of inverse Gaussian distribution, λ = -\frac{1}{2}, is available.

Author(s)

Thanh T. Tran frmqa.package@gmail.com

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

frmqa documentation built on May 2, 2019, 12:22 p.m.