Powered Exponential
PoweredExponential
PoweredExponential(
active_dims: Union[list[int], slice, None] = None,
lengthscale: Union[
LengthscaleCompatible, AbstractUnwrappable
] = 1.0,
variance: Union[ScalarFloat, AbstractUnwrappable] = 1.0,
power: Union[ScalarFloat, AbstractUnwrappable] = 1.0,
n_dims: Union[int, None] = None,
compute_engine: AbstractKernelComputation = DenseKernelComputation(),
)
Bases: StationaryKernel
The powered exponential family of kernels.
Computes the covariance for pairs of inputs \((x, y)\) with length-scale parameter \(\ell\), variance \(\sigma^2\) and power \(\kappa\). $$ k(x, y)=\sigma^2\exp\Bigg(-\Big(\frac{\lVert x-y\rVert_2}{\ell}\Big)^\kappa\Bigg) $$
This also equivalent to the symmetric generalized normal distribution. See Diggle and Ribeiro (2007) - "Model-based Geostatistics". and https://en.wikipedia.org/wiki/Generalized_normal_distribution#Symmetric_version
Parameters:
-
active_dims(Union[list[int], slice, None], default:None) –the indices of the input dimensions that the kernel operates on.
-
lengthscale(Union[LengthscaleCompatible, AbstractUnwrappable], default:1.0) –the lengthscale(s) of the kernel ℓ. If a scalar or an array of length 1, the kernel is isotropic, meaning that the same lengthscale is used for all input dimensions. If an array with length > 1, the kernel is anisotropic, meaning that a different lengthscale is used for each input.
-
variance(Union[ScalarFloat, AbstractUnwrappable], default:1.0) –the variance of the kernel σ.
-
power(Union[ScalarFloat, AbstractUnwrappable], default:1.0) –the power of the kernel κ.
-
n_dims(Union[int, None], default:None) –the number of input dimensions. If
lengthscaleis an array, this argument is ignored. -
compute_engine(AbstractKernelComputation, default:DenseKernelComputation()) –the computation engine that the kernel uses to compute the covariance matrix.
spectral_density
property
The normalised spectral measure \(p(\boldsymbol{\omega})\) of the kernel.
By Bochner's theorem, a stationary kernel is the Fourier transform of a finite measure. This property returns that measure normalised to a probability distribution over \(\mathbb{R}^D\), so that
The measure depends on the lengthscale \(\ell\) (as an inverse scale) but not on the variance \(\sigma^2\): the variance is the measure's total mass, which normalisation divides out, and it re-enters as the explicit prefactor above. The unnormalised spectral density of Rasmussen & Williams (2006, §4.2.1) is recovered as \(S(\boldsymbol{\omega}) = \sigma^2 (2\pi)^D p(\boldsymbol{\omega})\) under the convention \(k(\boldsymbol{\tau}) = (2\pi)^{-D}\int S(\boldsymbol{\omega}) e^{i\boldsymbol{\omega}^\top\boldsymbol{\tau}}\,d\boldsymbol{\omega}\).
Returns:
-
MultivariateNormal | MultivariateStudentT–The spectral measure as a \(D\)-dimensional numpyro distribution.
cross_covariance
Compute the cross-covariance matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) –the first input matrix of shape
(N, D). -
y(Num[Array, 'M D']) –the second input matrix of shape
(M, D).
Returns:
-
Float[Array, 'N M']–The cross-covariance matrix of the kernel of shape
(N, M).
gram
Compute the gram matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) –the input matrix of shape
(N, D).
Returns:
-
AbstractLinearOperator–The gram matrix of the kernel of shape
(N, N).
diagonal
Compute the diagonal of the gram matrix of the kernel.
Parameters:
-
x(Num[Array, 'N D']) –the input matrix of shape
(N, D).
Returns:
-
AbstractLinearOperator–The diagonal of the gram matrix of the kernel of shape
(N,).
slice_input
Slice out the relevant columns of the input matrix.
Select the relevant columns of the supplied matrix to be used within the kernel's evaluation.
Parameters:
-
x(Float[Array, '... D']) –the matrix or vector that is to be sliced.
Returns:
-
Float[Array, '... Q']–The sliced form of the input matrix.
__add__
Add two kernels together. Args: other (AbstractKernel): The kernel to be added to the current kernel.
Returns:
-
AbstractKernel(AbstractKernel) –A new kernel that is the sum of the two kernels.
__mul__
Multiply two kernels together.
Parameters:
-
other(AbstractKernel) –The kernel to be multiplied with the current kernel.
Returns:
-
AbstractKernel(AbstractKernel) –A new kernel that is the product of the two kernels.