Class KernelGaussian

java.lang.Object
edu.cmu.tetrad.search.utils.KernelGaussian
All Implemented Interfaces:
Kernel

public final class KernelGaussian extends Object implements Kernel
Soces the Gaussian kernel for a given bandwidth. Default bandwidth is set using the median distance heuristic.
Version:
$Id: $Id
Author:
Robert Tillman
  • Constructor Summary

    Constructors
    Constructor
    Description
    KernelGaussian(double sigma)
    Creates a new Gaussian kernel with the given bandwidth
    KernelGaussian(DataSet dataset, Node node)
    Creates a new Gaussian kernel using the median distance between points to set the bandwidth
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    eval(double i, double j)
    Evaluates the kernel at two points in the input space
    double
    getBandwidth.
    void
    setDefaultBw(DataSet dataset, Node node)
    Sets bandwidth from data using default method
    void
    Sets the bandwidth of the kernel to median distance between two points in the given vector

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KernelGaussian

      public KernelGaussian(double sigma)
      Creates a new Gaussian kernel with the given bandwidth
      Parameters:
      sigma - the bandwidth
    • KernelGaussian

      public KernelGaussian(DataSet dataset, Node node)
      Creates a new Gaussian kernel using the median distance between points to set the bandwidth
      Parameters:
      dataset - dataet containing variable used to set bandwidth
      node - variable used to set bandwidth
  • Method Details

    • getBandwidth

      public double getBandwidth()

      getBandwidth.

      Specified by:
      getBandwidth in interface Kernel
      Returns:
      the bandwidth
    • eval

      public double eval(double i, double j)
      Evaluates the kernel at two points in the input space

      Evaluates the kernel at two given points

      Specified by:
      eval in interface Kernel
      Parameters:
      i - a double
      j - a double
      Returns:
      a double
    • setDefaultBw

      public void setDefaultBw(DataSet dataset, Node node)
      Sets bandwidth from data using default method

      Default setting of bandwidth based on median distance heuristic

      Specified by:
      setDefaultBw in interface Kernel
      Parameters:
      dataset - a DataSet object
      node - a Node object
    • setMedianBandwidth

      public void setMedianBandwidth(DataSet dataset, Node node)
      Sets the bandwidth of the kernel to median distance between two points in the given vector
      Parameters:
      dataset - dataet containing variable used to set bandwidth
      node - variable used to set bandwidth