In order to measure the information density like proposed in section 3.2 of this paper I need a symmetric positive definite Kernel function. For this purpose I want to use the Gaussian Kernel like suggested in the paper.
When using the RBF Kernel from scikit-learn the user guide states that when setting gamma
to sigma negative square the kernel becomes a gaussian kernel of variance sigma squared. Here is the quote:
Where do I get the value for Sigma?
Is it the standard deviation of something?
Is Sigma calculated from the two input vectors xi and xj or do I need two whole sets of data?
Is the calculated value for sigma then really only raised to the power of -2?
Here is my current Python code for the problem:
def gaussian_kernel(x_i, x_j):
# if gamma = sigma negative square then the kernel is known as the
# Gaussian kernel of variance sigma square
sigma = 0 # how to calculate sigma and sigma negativ squared?
gamma = sigma**-2 # <- is this even correct?
kernel_result = rbf_kernel(x_i, x_j, gamma)
return kernel_result