Description Usage Arguments Details Note Author(s) References Examples
Approximates incomplete modified Bessel function using the algorithm provided by Slevinsky and Safouhi (2010) and gives warnings when loss of accuracy or an exception occurs.
1 2 | besselK_inc_ite(x, y, lambda, traceIBF = TRUE, epsilon = 0.95,
nmax = 120)
|
x |
Argument, x > 0. |
y |
Argument, y > 0. |
lambda |
Order of the BesselK function. |
traceIBF |
Logical, tracks the approximation process
if |
epsilon |
Determines approximation accuracy
which equals machine
accuracy raised to the power of |
nmax |
Integer. Maximum number of iterations required. |
One of the integral representations of the incomplete Bessel function is given by
K_{λ}(x, y) = \int_1^{∞}\, e^{-xt -y/t}\,t^{-λ-1}\,dt,
besselK_inc_ite
is the R
version of the routine described in Slevinsky and
Safouhi (2010) which encounters computional problems
when x
and y
increase. Function besselK_inc_ite
detects such problems and gives warnings when they occur.
A C++ version of this function will be added in due course.
Thanh T. Tran frmqa.package@gmail.com
Scott, D (2012) DistributionUtils: Distribution Utilities, R package version 0.5-1, http://CRAN.R-project. org/package=GeneralizedHyperbolic.
Slevinsky, R. M., and Safouhi, H (2010) A recursive algorithm for the G transformation and accurate computation of incomplete Bessel functions. Appl. Numer. Math., 60 1411–1417.
Kahan, W (1981) Why do we need a foating-point arithmetic standard? http://www.cs.berkeley.edu/ wkahan/ieee754status/why-ieee.pdf.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## "Exact" evaluation are given by Maple 15
options(digits = 16)
## Gives accurate approximations
## x = 0.01, y = 4, lambda = 0, exact value = 2.225 310 761 266 4692
besselK_inc_ite(0.01, 4, 0, traceIBF = FALSE, epsilon = 0.95, nmax = 160)
## x = 1, y = 4, lambda = 2, exact value = 0.006 101 836 926 254 8540
besselK_inc_ite(1, 4, 2, traceIBF = FALSE, epsilon = 0.95, nmax = 160)
## NaN occurs
## x = 1, y = 1.5, lambda = 8, exact value = 0.010 515 920 838 551 3164
## Not run: besselK_inc_ite(1, 1.5, 8, traceIBF = TRUE, epsilon = 0.95,
nmax = 180)
## End(Not run)
##Loss of accuracy
## x = 14.5, y = 19, lambda = 0, exact value = 9.556 185 644 444 739 5139(-16)
besselK_inc_ite(14.75, 19, 2, traceIBF = TRUE, epsilon = 0.95, nmax = 160)
## x = 17, y = 15, lambda = 1, exact value= 1.917 488 390 220 793 6555(-15)
besselK_inc_ite(17, 15, 1, traceIBF = TRUE, epsilon = 0.95, nmax = 160)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.