Skip to content
fn

i0e

→Tensor
i0e(input: Tensor)

Exponentially scaled modified Bessel function of order 0.

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

Parameters

inputTensor
Input tensor; any floating-point dtype.

Returns

Tensor

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

Notes

Mathematical definition:

I0(x)e−∣x∣,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 x→∞x \to \infty, I0(x)e−x∼1/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., 0.4658, 0.1835, 0.08978])