class revrand.basis_functions.RandomMatern32(nbases, Xdim, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None, random_state=None)

Random Matern 3/2 Basis – Approximates a Matern 3/2 kernel function.

This will make a linear regression model approximate a GP with an (optionally ARD) Matern covariance function.

\[\phi(\mathbf{x})^\top \phi(\mathbf{x}') \approx \left(1 + \frac{\sqrt{3} \| \mathbf{x} - \mathbf{x}' \|}{l} \right) \exp \left(- \frac{\sqrt{3} \| \mathbf{x} - \mathbf{x}' \|}{l} \right)\]

with a length scale, \(l\) (a vector in \(\mathbb{R}^d\) for ARD).

  • nbases (int) – how many unique random bases to create (twice this number will be actually created, i.e. real and imaginary components for each base)
  • Xdim (int) – the dimension (d) of the observations (or the dimension of the slices if using apply_ind).
  • lenscale (Parameter, optional) – A scalar or vector of shape (1,) or (d,) Parameter to bound and initialise the length scales for optimization. If this is shape (d,), ARD length scales will be expected, otherwise an isotropic lenscale is learned.
  • regularizer (None, Parameter, optional) – The (initial) value of the regularizer/prior variance to apply to the regression weights of this basis function. The Parameter object must have a scalar value. If it is not set, it will take on a default value of Parameter(gamma(1.), Positive()).
  • random_state (None, int or RandomState, optional) – random seed
__init__(nbases, Xdim, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None, random_state=None)

See this class’s docstring.


__init__(nbases, Xdim[, lenscale, bounds, ...]) See this class’s docstring.
get_dim(X) Get the output dimensionality of this basis.
grad(X[, lenscale]) Get the gradients of this basis w.r.t.the length scales.
params_values() Get a list of the Parameter values if they have a value.
regularizer_diagonal(X[, regularizer]) Get the diagonal of the prior variance on the weights (regularizer).
transform(X[, lenscale]) Apply the random basis to X.


params Get this basis’ Parameter types.
regularizer Get the Parameter value of this basis’ regularizer.