Skip to content

Utils

build_student_t_distribution

build_student_t_distribution(
    nu: int, scale_tril: Float[Array, "D D"]
) -> npd.MultivariateStudentT

Build the spectral measure of a Matérn kernel.

The Matérn kernel with smoothness \(\nu\) has spectral density proportional to \((2\nu/\ell^2 + \lVert\omega\rVert^2)^{-(\nu + D/2)}\), which normalises to a multivariate Student's t measure with \(2\nu\) degrees of freedom and scale matrix \(\mathrm{diag}(\ell)^{-1}\).

Parameters:

  • nu (int) –

    Twice the smoothness parameter of the Matérn kernel, i.e. 1, 3 or 5 for the Matérn-1/2, -3/2 and -5/2 kernels respectively.

  • scale_tril (Float[Array, 'D D']) –

    The scale matrix \(\mathrm{diag}(\ell)^{-1}\) of the measure, as returned by StationaryKernel._spectral_scale_tril.

Returns

npd.MultivariateStudentT: The spectral measure over $\mathbb{R}^D$.

squared_distance

squared_distance(
    x: Float[Array, " D"], y: Float[Array, " D"]
) -> ScalarFloat

Compute the squared distance between a pair of inputs.

Parameters:

  • x (Float[Array, ' D']) –

    First input.

  • y (Float[Array, ' D']) –

    Second input.

Returns

ScalarFloat: The squared distance between the inputs.

euclidean_distance

euclidean_distance(
    x: Float[Array, " D"], y: Float[Array, " D"]
) -> ScalarFloat

Compute the euclidean distance between a pair of inputs.

Parameters:

  • x (Float[Array, ' D']) –

    First input.

  • y (Float[Array, ' D']) –

    Second input.

Returns

ScalarFloat: The euclidean distance between the inputs.