Learn R Programming

frmqa (version 0.1-5)

besselK_inc_err: Calculation of the Incomplete BesselK Functions in Terms of the Complementary Error Functions

Description

Calculates incomplete BesselK functions by evaluating explicit expressions for the lower and upper incomplete BesselK in terms of the complementary error function by calling CalIncLapInt.

Usage

besselK_inc_err(x, z, lambda, bit, lower = FALSE)

Arguments

Details

One of the integral representations of the lower incomplete BesselK is given by $$\widehat K_{\lambda}(z, x) = \frac{1}{\left(2z\right)^{\lambda}}\,\int_0^x\, e^{-\left{z^2\,\xi^2 \,+\, 1/(4\, \xi^2)\right}}\, \xi^{-2\lambda -1}\, d\xi,$$ which appears in the distribution function of the generalized inverse Gaussian distribution, see Barndorff-Nielsen(1977).

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

besselK_inc_clo, gamma_inc_clo, pgig

Examples

Run this code
## Accuracy tests
  x <- 2
  z <- 5
  lambda <- -c(1/2, 3/2)
  lower <- sapply(lambda, function(w.)
    besselK_inc_err(x, z, lambda = w., 200, lower = TRUE))
  upper <- sapply(lambda, function(w.)
    besselK_inc_err(x, z, lambda = w., 200, lower = FALSE)) 
  ## sum of two parts   
  (lower + upper)
  ## equals the whole function
  (besselK(z, nu = lambda))

Run the code above in your browser using DataLab