I'm looking to implement a discrete Gaussian kernel , as defined by Lindeberg in his work on the theory of spatial space.
It is defined as T (n, t) = exp (-t) * I_n (t), where I_n is a modified Bessel function of the first kind .
I am trying to implement this in Python using Numpy and Scipy, but in some problems.
def discrete_gaussian_kernel(t, n):
return math.exp(-t) * scipy.special.iv(n, t)
I am trying to build with:
import math
import numpy as np
import scipy
from matplotlib import pyplot as plt
def kernel(t, n):
return math.exp(-t) * scipy.special.iv(n, t)
ns = np.linspace(-5, 5, 1000)
y0 = discrete_gaussian_kernel(0.5, ns)
y1 = discrete_gaussian_kernel(1, ns)
y2 = discrete_gaussian_kernel(2, ns)
y3 = discrete_gaussian_kernel(4, ns)
plt.plot(ns, y0, ns, y1, ns, y2, ns, y3)
plt.xlim([-4, 4])
plt.ylim([0, 0.7])
The result is as follows:

From a Wikipedia article, it should look like this:

I suppose I'm making some very empty mistake.: / Any suggestions? Thank!
EDIT:
, , scipy.special.ive(n, t). , , , - ?