Spectral Densities

A kernel $k(x,y)$ is described as stationary or shift-invariant, if it can be written as $k(τ) = k(x-y)$, which means that it only depends on the difference between $x$ and $y$ but not their absolute values.

For a given stationary kernel $k(τ)$, the spectral density is its Fourier transform

\[S(\omega) = \int_{-\infty}^{\infty} k(τ) e^{-2 \pi \omega^T \tau} d\tau\]

Note

The exact form of the Fourier transform may change slightly between fields (see Details and Options). This package uses the "signal processing" form above, as done in this presentation by Markus Heinonen. However, Rahimi & Recht used the "classical physics" form, for example. All options are equivalent, if used consistently.

Shared interface

KernelSpectralDensities.SpectralDensityType
SpectralDensity{K<:Kernel}(k::Kernel, dim::Int)

Spectral density for the kernel K for dim dimensional frequency space.

Definition

Given a stationary kernel $k(x, x')$ the spectral density is the Fourier transform of $k(τ) = k(x-x')$. It can be seen as a probablity density function over the frequency domain, and can be evaluated at any frequency w.

Examples

julia> k = SqExponentialKernel();

julia> S = SpectralDensity(k, 1);

julia> S(0.0)
2.5066282746310007

julia> S = SpectralDensity(k, 2);

julia> S(zeros(2))
6.2831853071795845
source
Base.randMethod
rand(S::AbstractSpectralDensity, [n::Int])

Generate a sample [n samples] from the spectral density S. For a scalar spectral density over $ω \in R$, computing n samples results in a n dimensional vector. For a multi-dimensional spectral density over $ω \in R^d, d>1$, computing n samples results in a d,n matrix.

Examples

julia> k = SqExponentialKernel();

julia> S = SpectralDensity(k, 1);

julia> rand(S, 1);
source

Supported Kernel

  • Squared Exponential
  • Any Matern Kernel

Supported Transformations

  • with_lengthscale