returns the Matern covariance function.
covf = cov_matern(x1, x2)
covf = cov_matern(x1, x2)
takes two matrices x1
, x2
of
input vectors and computes the matrix of covariance function covf
. If
called with a single input x1
, the function returns the diagonal of
cov_matern(x1,x1)
.
This kernel function assumes that the output is one-dimensional.
This kernel is implemented as an external kernel, thus
net.covarfn='user'
.
As with the default kernel types, the field net.kpar
contains the input scales in the first net.nin
variables followed by the
amplitude and matern kernel order.
Since the type of the kernel is user
, there are two additional fields
in the structure net
:
kfnaddr
- the address of the function returning the kernel matrix.
gradkaddr
- the address of the function returning the gradient of the covariance function w.r.t. a kernel parameter.
The Matern covariance function is computed as:
K(x,y) = A * (2*sqrt(b)|x-y|)^b*besselk(2*sqrt(b)*|x-y|,b) /(2^(b-1)*gamma(b))
The positive constant b
is the order of the kernel, stored as
b=exp(net.kpar(nin+2))
and the scale of the kernel is
A=exp(net.kpar(nin+1))
. The values of the absolute differences are
computed using the inputs x
and y
weighted with the square root
of the scaling constant.
The kernel parameters are taken from the global variable net
.
besselk
is the modified Bessel function of the second kind.
If the order is above 100
, then the matern kernel is identical with
the RBF kernel, and the gradient with respect to the order is set to zero.
ogpcovarf
, ogpcovgrad
, covgrad_matern
, demogp_matern
Copyright (c) Lehel Csató (2001-2004)