Kernel

class stonesoup.kernel.Kernel[source]

Kernel base type

A Kernel provides a means to translate state space or measurement space into kernel space.

class stonesoup.kernel.AdditiveKernel(kernel_list: Sequence[Kernel])[source]

Additive kernel

Elementwise addition of corresponding kernel state values. Similar to an OR operation.

Parameters:

kernel_list (collections.abc.Sequence) – List of kernels

kernel_list: Sequence[Kernel]

List of kernels

class stonesoup.kernel.MultiplicativeKernel(kernel_list: Sequence[Kernel])[source]

Multiplicative kernel

Elementwise multiplication of corresponding kernel state values. Similar to an AND operation.

Parameters:

kernel_list (collections.abc.Sequence) – List of kernels

kernel_list: Sequence[Kernel]

List of kernels

class stonesoup.kernel.PolynomialKernel(power: int, c: float = 1, ialpha: float = 10.0)[source]

Polynomial Kernel

This kernel returns the polynomial kernel of order \(p\) state from a pair of State objects.

The polynomial kernel of state vectors \(\mathbf{x}\) and \(\mathbf{x}^\prime\) is defined as:

\[\mathtt{k}(\mathbf{x}, \mathbf{x}^\prime) = \left(\alpha \left\langle \mathbf{x}, \mathbf{x}^\prime \right\rangle + c \right) ^ p\]
Parameters:
  • power (int) – The polynomial power \(p\).

  • c (float, optional) – Free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. Default is 1.

  • ialpha (float, optional) – Slope. Range is [1e0, 1e4]. Default is 1e1.

power: int

The polynomial power \(p\).

c: float

Free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. Default is 1.

ialpha: float

Slope. Range is [1e0, 1e4]. Default is 1e1.

class stonesoup.kernel.LinearKernel[source]

Linear Kernel

This kernel returns the linear kernel state vector from a pair of State objects.

The linear kernel of state vectors \(\mathbf{x}\) and \(\mathbf{x}^\prime\) is defined as:

\[\mathtt{k}\left(\mathbf{x}, \mathbf{x}^\prime\right) = \mathbf{x}^T\mathbf{x}^\prime\]

The linear kernel can capture the first-order moments of a distribution, such as the mean and covariance.

property power

The linear polynomial power, \(p=1\)

property c

Free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. Default is 1.

property ialpha

Slope. Range is [1e0, 1e4]. Default is 1e1.

class stonesoup.kernel.QuadraticKernel(c: float = 1, ialpha: float = 10.0)[source]

Quadratic Kernel type

This kernel returns the quadratic kernel state vector from a pair of State objects.

The quadratic kernel of state vectors \(\mathbf{x}\) and \(\mathbf{x}^\prime\) is defined as:

\[\mathtt{k}\left(\mathbf{x}, \mathbf{x}^\prime\right) = \left(\alpha \langle \mathbf{x}, \mathbf{x}^\prime \rangle + c\right)^2\]

The quadratic kernel can capture the second-order moments of a distribution, such as the covariance and correlations between pairs of variables. The quadratic kernel is appropriate when the data is nonlinear but still relatively simple.

Parameters:
  • c (float, optional) – Free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. Default is 1.

  • ialpha (float, optional) – Slope. Range is [1e0, 1e4]. Default is 1e1.

property power

The quadratic polynomial power, \(p=2\)

class stonesoup.kernel.QuarticKernel(c: float = 1, ialpha: float = 10.0)[source]

Quartic Kernel

This kernel returns the quartic kernel state from a pair of State objects.

The quartic kernel of state vectors \(\mathbf{x}\) and \(\mathbf{x}^\prime\) is defined as:

\[\mathtt{k}(\mathbf{x}, \mathbf{x}^\prime) = \left(\alpha \langle \mathbf{x}, \mathbf{x}^\prime \rangle + c\right)^4\]

The quartic kernel can capture higher-order moments beyond the mean and covariance, such as skewness and kurtosis. THe quartic kernel can be used when the data is highly nonlinear and complex.

Parameters:
  • c (float, optional) – Free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. Default is 1.

  • ialpha (float, optional) – Slope. Range is [1e0, 1e4]. Default is 1e1.

property power

The quartic polynomial power, \(p=4\)

class stonesoup.kernel.GaussianKernel(variance: float = 10.0)[source]

Gaussian Kernel

This kernel returns the Gaussian kernel state vector from a pair of State objects.

The Gaussian kernel of state vectors \(\mathbf{x}\) and \(\mathbf{x}^\prime\) is defined as:

\[\mathtt{k}(\mathbf{x}, \mathbf{x}^\prime) = \mathrm{exp}\left(-\frac{||\mathbf{x} - \mathbf{x}^\prime||^{2}}{2\pi\sigma^2}\right)\]
Parameters:

variance (float, optional) – Denoted as \(\sigma^2\) in the equation above. Determines the width of the Gaussian kernel. Range is [1e0, 1e2].

variance: float

Denoted as \(\sigma^2\) in the equation above. Determines the width of the Gaussian kernel. Range is [1e0, 1e2].

class stonesoup.kernel.TrackKernel(kernel: Kernel, mapping: list = None)[source]
Parameters:
  • kernel (Kernel) – Base Kernel class

  • mapping (list, optional) – List of mappings of the components to be used in the kernel from the state vector.

class stonesoup.kernel.MeasurementKernel(kernel: Kernel, mapping: list = None)[source]
Parameters:
  • kernel (Kernel) – Base Kernel class

  • mapping (list, optional) – List of mappings of the components to be used in the kernel from the state vector.