Class Matern

java.lang.Object
smile.math.kernel.Matern
All Implemented Interfaces:
Serializable, Function, IsotropicKernel
Direct Known Subclasses:
BinarySparseMaternKernel, MaternKernel, SparseMaternKernel

public class Matern extends Object implements IsotropicKernel
The class of Matérn kernels is a generalization of the Gaussian/RBF. It has an additional parameter nu which controls the smoothness of the kernel function. The smaller nu, the less smooth the approximated function is. As nu -> inf, the kernel becomes equivalent to the Gaussian/RBF kernel. When nu = 1/2, the kernel becomes identical to the Laplacian kernel. The Matern kernel become especially simple when nu is half-integer. Important intermediate values are 3/2 (once differentiable functions) and 5/2 (twice differentiable functions).
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Matern(double sigma, double nu, double lo, double hi)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    f(double dist)
    Computes the value of the function at x.
    double
    k(double dist)
    Computes the isotropic kernel function.
    double[]
    kg(double dist)
    Computes the isotropic kernel function and its gradient over hyperparameters.
    double
    Returns the length scale of kernel.
    double
    Returns the smoothness of kernel.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface smile.math.Function

    inv

    Methods inherited from interface smile.math.kernel.IsotropicKernel

    apply, K, KG
  • Constructor Details

    • Matern

      public Matern(double sigma, double nu, double lo, double hi)
      Constructor.
      Parameters:
      sigma - The length scale of kernel.
      nu - The smoothness of the kernel function. Only 0.5, 1.5, 2.5 and Inf are accepted. The smoothness parameter is fixed during hyperparameter for tuning.
      lo - The lower bound of length scale for hyperparameter tuning.
      hi - The upper bound of length scale for hyperparameter tuning.
  • Method Details

    • scale

      public double scale()
      Returns the length scale of kernel.
      Returns:
      the length scale of kernel.
    • smoothness

      public double smoothness()
      Returns the smoothness of kernel.
      Returns:
      the smoothness of kernel.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • f

      public double f(double dist)
      Description copied from interface: Function
      Computes the value of the function at x.
      Specified by:
      f in interface Function
      Specified by:
      f in interface IsotropicKernel
      Parameters:
      dist - a real number.
      Returns:
      the function value.
    • k

      public double k(double dist)
      Description copied from interface: IsotropicKernel
      Computes the isotropic kernel function.
      Specified by:
      k in interface IsotropicKernel
      Parameters:
      dist - The distance.
      Returns:
      the kernel value.
    • kg

      public double[] kg(double dist)
      Description copied from interface: IsotropicKernel
      Computes the isotropic kernel function and its gradient over hyperparameters.
      Specified by:
      kg in interface IsotropicKernel
      Parameters:
      dist - The distance.
      Returns:
      the kernel value and gradient.