Learn R Programming

frmqa (version 0.1-5)

gamma_inc_err: Accurate Calculation of the Incomplete Gamma Functions Using Analytical Formulae

Description

Evaluates explicit formulae for the lower and upper incomplete gamma functions in terms of complementary error function by calling CalIncLapInt.

Usage

gamma_inc_err(x, lambda, bit, lower = FALSE)

Arguments

Details

The lower incomplete gamma function is given by $$\gamma(x, \lambda) = \int_0^x e^{-t}\,t^{\lambda - 1}\, dt.$$

References

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 (2011) Some Problems Concerning the Generalized Hyperbolic and Related Distributions. Ph.D Thesis. The University of Auckland, New Zealand. 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, besselK_inc_clo, pgig

Examples

Run this code
## Accuracy tests
  x <- 3
  lambda <- 3/2
  lower <- sapply(lambda, function(w.)
    gamma_inc_err(x, lambda = w., 200, lower = TRUE))
  upper <- sapply(lambda, function(w.)
    gamma_inc_err(x, lambda = w., 200, lower = FALSE))  
 ## sum of two parts   
  (lower + upper)
 ## equals the whole function 
  (gamma(lambda))

Run the code above in your browser using DataLab