bI {Bessel}R Documentation

Bessel I() function Simple Series Representation

Description

Computes the modified Bessel I function, using one of its basic definitions as an infinite series. The implementation is pure R, working for numeric, complex, but also e.g., for objects of class "mpfr" from package Rmpfr.

Usage

bI(x, nu, nterm = 800, expon.scaled = FALSE, log = FALSE,
   Ceps = if (isNum) 8e-16 else 2^(-x@.Data[[1]]@prec))

Arguments

x

numeric of complex vector, or of another class for which arithmetic methods are defined, notably objects of class mpfr.

nu

non-negative numeric (scalar).

nterm

integer indicating the number of terms to be used. should be in the order of abs(x), but can be smaller for large x. A warning is given, when nterm was chosen too small.

expon.scaled

logical indicating if the result should be scaled by exp(-abs(x)).

log

logical indicating if the logarithm log I.() is required. is not yet implemented !

Ceps

a relative error tolerance for checking if nterm has been sufficient. The default is “correct” for double precision and also for multiprecision objects.

Value

a “numeric” (or complex or ...) vector of the same class and length as x.

Author(s)

Martin Maechler

References

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

See Also

This package BesselI, base besselI, etc

Examples

stopifnot(all.equal(bI     (1:10, 1), # R code
                    besselI(1:10, 1)))# internal C code w/ different algorithm

[Package Bessel version 0.5-5 Index]