Documentation
Classes
Matern

Matern

Matern kernel.

The class of Matern kernels is a generalization of the RBF. It has an additional parameter \(\nu\) which controls the smoothness of the resulting function. The smaller \(\nu\), the less smooth the approximated function is. As \(\nu\rightarrow\infty\), the kernel becomes equivalent to the RBF kernel. When \(\nu = 1/2\), the Matérn kernel becomes identical to the absolute exponential kernel. Important intermediate values are \(\nu=1.5\) (once differentiable functions) and \(\nu=2.5\) (twice differentiable functions).

The kernel is given by:

Python Reference (opens in a new tab)

Constructors

constructor()

Signature

new Matern(opts?: object): Matern;

Parameters

NameTypeDescription
opts?object-
opts.length_scale?number | ArrayLikeThe length scale of the kernel. If a float, an isotropic kernel is used. If an array, an anisotropic kernel is used where each dimension of l defines the length-scale of the respective feature dimension. Default Value 1
opts.length_scale_bounds?"fixed"The lower and upper bound on ‘length_scale’. If set to “fixed”, ‘length_scale’ cannot be changed during hyperparameter tuning.
opts.nu?numberThe parameter nu controlling the smoothness of the learned function. The smaller nu, the less smooth the approximated function is. For nu=inf, the kernel becomes equivalent to the RBF kernel and for nu=0.5 to the absolute exponential kernel. Important intermediate values are nu=1.5 (once differentiable functions) and nu=2.5 (twice differentiable functions). Note that values of nu not in [0.5, 1.5, 2.5, inf] incur a considerably higher computational cost (appr. 10 times higher) since they require to evaluate the modified Bessel function. Furthermore, in contrast to l, nu is kept fixed to its initial value and not optimized. Default Value 1.5

Returns

Matern

Defined in: generated/gaussian_process/kernels/Matern.ts:25 (opens in a new tab)

Properties

_isDisposed

boolean = false

Defined in: generated/gaussian_process/kernels/Matern.ts:23 (opens in a new tab)

_isInitialized

boolean = false

Defined in: generated/gaussian_process/kernels/Matern.ts:22 (opens in a new tab)

_py

PythonBridge

Defined in: generated/gaussian_process/kernels/Matern.ts:21 (opens in a new tab)

id

string

Defined in: generated/gaussian_process/kernels/Matern.ts:18 (opens in a new tab)

opts

any

Defined in: generated/gaussian_process/kernels/Matern.ts:19 (opens in a new tab)

Accessors

anisotropic

Signature

anisotropic(): Promise<any>;

Returns

Promise<any>

Defined in: generated/gaussian_process/kernels/Matern.ts:262 (opens in a new tab)

hyperparameter_length_scale

Signature

hyperparameter_length_scale(): Promise<any>;

Returns

Promise<any>

Defined in: generated/gaussian_process/kernels/Matern.ts:282 (opens in a new tab)

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/gaussian_process/kernels/Matern.ts:49 (opens in a new tab)

Signature

py(pythonBridge: PythonBridge): void;

Parameters

NameType
pythonBridgePythonBridge

Returns

void

Defined in: generated/gaussian_process/kernels/Matern.ts:53 (opens in a new tab)

Methods

__call__()

Return the kernel k(X, Y) and optionally its gradient.

Signature

__call__(opts: object): Promise<ArrayLike[]>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Left argument of the returned kernel k(X, Y)
opts.Y?ArrayLike[]Right argument of the returned kernel k(X, Y). If undefined, k(X, X) if evaluated instead.
opts.eval_gradient?booleanDetermines whether the gradient with respect to the log of the kernel hyperparameter is computed. Only supported when Y is undefined. Default Value false

Returns

Promise<ArrayLike[]>

Defined in: generated/gaussian_process/kernels/Matern.ts:122 (opens in a new tab)

clone_with_theta()

Returns a clone of self with given hyperparameters theta.

Signature

clone_with_theta(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.theta?ArrayLikeThe hyperparameters

Returns

Promise<any>

Defined in: generated/gaussian_process/kernels/Matern.ts:171 (opens in a new tab)

diag()

Returns the diagonal of the kernel k(X, X).

The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.

Signature

diag(opts: object): Promise<ArrayLike>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Left argument of the returned kernel k(X, Y)

Returns

Promise<ArrayLike>

Defined in: generated/gaussian_process/kernels/Matern.ts:206 (opens in a new tab)

dispose()

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Signature

dispose(): Promise<void>;

Returns

Promise<void>

Defined in: generated/gaussian_process/kernels/Matern.ts:105 (opens in a new tab)

init()

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Signature

init(py: PythonBridge): Promise<void>;

Parameters

NameType
pyPythonBridge

Returns

Promise<void>

Defined in: generated/gaussian_process/kernels/Matern.ts:62 (opens in a new tab)

is_stationary()

Returns whether the kernel is stationary.

Signature

is_stationary(opts: object): Promise<any>;

Parameters

NameType
optsobject

Returns

Promise<any>

Defined in: generated/gaussian_process/kernels/Matern.ts:239 (opens in a new tab)