rStats.js v1.3.0
    Preparing search index...

    Function besselI

    • Modified Bessel function of the first kind. Equivalent to R's besselI(x, nu, expon.scaled = FALSE). Takes single numbers.

      Parameters

      • x: number

        Argument, x >= 0 (NaN for negative x).

      • nu: number

        Order, any real number. For nu < 0, I(x, -nu) = I(x, nu) + 2/pi sin(pi nu) K(x, nu) (A&S 9.6.2, as in R).

      • options: BesselOptions = {}

        exponScaled (see BesselOptions).

      Returns number

      I_nu(x), or exp(-x) I_nu(x) when exponScaled.

      For orders above 1000, results far out of the range of doubles are returned at once (Infinity or 0, decided by bounds on their log); otherwise the time grows with the order (a recurrence of about nu steps): several seconds at nu = 1e8. Beyond 2^28 steps, and for besselI where its continued fraction does not converge (x above about 5e10), Debye's uniform expansion is used; a RangeError is thrown only where its exponent nu eta - x is formed from terms above 2^26 and the result is in range (near x = 0.66 nu, unscaled).

      besselI(1, 0);                             // 1.2660658777520086
      besselI(1000, 2, { exponScaled: true }); // 0.012592018595377398