Bessel: Bessel Functions of Complex Arguments I(), J(), K(), and Y()

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

Description

Compute the Bessel functions I(), J(), K(), and Y(), of complex arguments z and real nu,

Usage

1
2
3
4
BesselI(z, nu, expon.scaled = FALSE, nSeq = 1)
BesselJ(z, nu, expon.scaled = FALSE, nSeq = 1)
BesselK(z, nu, expon.scaled = FALSE, nSeq = 1)
BesselY(z, nu, expon.scaled = FALSE, nSeq = 1)

Arguments

z

complex or numeric vector.

nu

numeric (scalar).

expon.scaled

logical indicating if the result should be scaled by an exponential factor (typically to avoid under- or over-flow), as for besselI() etc.

nSeq

positive integer; if > 1, computes the result for a whole sequence of nu values;
if nu >= 0,nu, nu+1, ..., nu+nSeq-1,
if nu < 0, nu, nu-1, ..., nu-nSeq+1.

Details

The case nu < 0 is handled by using simple formula from Abramowitz and Stegun, see details in besselI().

Value

a complex or numeric vector (or matrix with nSeq columns if nSeq > 1) of the same length (or nrow when nSeq > 1) and mode as z.

Author(s)

Donald E. Amos, Sandia National Laboratories, wrote the original fortran code. Martin Maechler did the R interface.

References

Abramowitz, M., and Stegun, I. A. (1955, etc). Handbook of mathematical functions (NBS AMS series 55, U.S. Dept. of Commerce).

D. E. Amos (1986) Algorithm 644: A portable package for Bessel functions of a complex argument and nonnegative order; ACM Trans. Math. Software 12, 3, 265–273.

D. E. Amos (1983) Computation of Bessel Functions of Complex Argument; Sand83-0083.

D. E. Amos (1983) Computation of Bessel Functions of Complex Argument and Large Order; Sand83-0643.

D. E. Amos (1985) A subroutine package for Bessel functions of a complex argument and nonnegative order; Sand85-1018.

Olver, F.W.J. (1974). Asymptotics and Special Functions; Academic Press, N.Y., p.420

See Also

The base R functions besselI(), besselK(), etc.

For large x and/or nu arguments, algorithm AS~644 is not good enough, and the results may overflow to Infor underflow to zero, such that direct computation of \log(I_ν(x)) and \log(K_ν(x)) are desirable. For this, we provide besselI.nuAsym() and besselK.nuAsym(*, log= *), based on asymptotic expansions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## For real small arguments, BesselI() gives the same as base::besselI() :
set.seed(47); x <- sort(round(rlnorm(20), 2))
M <- cbind(x, b = besselI(x, 3), B = BesselI(x, 3))
stopifnot(all.equal(M[,"b"], M[,"B"], tol = 2e-15)) # ~4e-16 even
M

## and this is true also for the 'exponentially scaled' version:
Mx <- cbind(x, b = besselI(x, 3, expon.scaled=TRUE),
               B = BesselI(x, 3, expon.scaled=TRUE))
stopifnot(all.equal(Mx[,"b"], Mx[,"B"], tol = 2e-15)) # ~4e-16 even

Bessel documentation built on May 2, 2019, 4:38 p.m.