gamma_inc_err: Accurate Calculation of the Incomplete Gamma Functions Using...

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

View source: R/frmqa.R

Description

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

Usage

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

Arguments

x

Argument, x > 0.

lambda

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

lower

Logical. Lower incomplete gamma function is calculated if TRUE.

bit

Precision bit. A positive integer greater or equal 100.

Details

The lower incomplete gamma function is given by

γ(x, λ) = \int_0^x e^{-t}\,t^{λ - 1}\, dt.

Note

This function evaluates formulae in terms of complementary error function for γ(x, λ) and its upper counterpart when λ = \pm(j + \frac{1}{2}). Currently, such formulae are only available when λ = \pm\frac{1}{2}.

Author(s)

Thanh T. Tran frmqa.package@gmail.com

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

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

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