fn

i0e

Tensor
i0e(x: Tensor)
source

Exponentially scaled modified Bessel function of order 0.

Computes I0(x)exI_0(x)\, e^{-|x|}, the standard exponentially-scaled variant of the modified Bessel function of the first kind. I_0 itself grows as ex/xe^{|x|}/\sqrt{|x|} and therefore overflows floating-point representation for moderately large arguments; the scaled form is bounded by 1 for x0x \ge 0 and is the natural quantity to manipulate in log-density computations (von Mises / Bessel distributions, Rice distribution, etc.).

Parameters

xTensor
Input tensor; any floating-point dtype.

Returns

Tensor

I0(x)exI_0(x)\, e^{-|x|} element-wise, same shape and dtype as x.

Notes

Mathematical definition:

I0(x)ex,I0(x)=k=0(x/2)2k(k!)2.I_0(x) e^{-|x|}, \quad I_0(x) = \sum_{k=0}^\infty \frac{(x/2)^{2k}}{(k!)^2}.

The function is even and equals 1 at x = 0. For xx \to \infty, I0(x)ex1/2πxI_0(x) e^{-x} \sim 1/\sqrt{2\pi x}. Related identities: i0e(0) = 1 and i0e(x) <= 1 for all real x.

Examples

>>> import lucid
>>> from lucid.special import i0e
>>> i0e(lucid.tensor([0.0, 1.0, 5.0, 20.0]))
Tensor([1.0000, 0.4658, 0.1835, 0.0897])