STAG Python  2.0.2
Spectral Toolkit of Algorithms for Graphs
Loading...
Searching...
No Matches
stag.kde Namespace Reference

Classes

class  CKNSGaussianKDE
 A CKNS Gaussian KDE data structure. More...
 
class  ExactGaussianKDE
 A data structure for computing the exact Gauussian KDE. More...
 

Functions

def gaussian_kernel (float a, stag.data.DataPoint u, stag.data.DataPoint v)
 Compute the Gaussian kernel similarity between the points u and v.
 
float gaussian_kernel_dist (float a, float c)
 Compute the Gaussian kernel similarity for two points at a squared distance \(c\).
 

Function Documentation

◆ gaussian_kernel()

def stag.kde.gaussian_kernel ( float  a,
stag.data.DataPoint  u,
stag.data.DataPoint  v 
)

Compute the Gaussian kernel similarity between the points u and v.

Given a parameter \(a \geq 0\) and points \(u, v \in \mathbb{R}^n\), the Gaussian kernel similarity between \(u\) and \(v\) is given by

\[ k(u, v) = \exp\left( - a \|u - v\|^2_2 \right). \]

Note that the Gaussian kernel is sometimes parameterised by \(\sigma^2\), which is related to our parameter \(a\) by

\[ a = \frac{1}{\sigma^2}. \]

Parameters
athe parameter a in the Gaussian kernel.
ua data point \(u\)
va data point \(v\)
Returns
the Gaussian kernel similarity between \(u\) and \(v\).

◆ gaussian_kernel_dist()

float stag.kde.gaussian_kernel_dist ( float  a,
float  c 
)

Compute the Gaussian kernel similarity for two points at a squared distance \(c\).

Given a parameter \(a \geq 0\), the Gaussian kernel similarity between two points at distance \(c\) is given by

\[ \exp\left( - a c \right). \]

Parameters
athe parameter a in the Gaussian kernel.
cthe squared distance between two points.
Returns
the kernel evaluated at distance \(c\).