MLPACK  1.0.7
epanechnikov_kernel.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_KERNELS_EPANECHNIKOV_KERNEL_HPP
23 #define __MLPACK_CORE_KERNELS_EPANECHNIKOV_KERNEL_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace kernel {
29 
40 {
41  public:
47  EpanechnikovKernel(const double bandwidth = 1.0) :
50  { }
51 
58  template<typename Vec1Type, typename Vec2Type>
59  double Evaluate(const Vec1Type& a, const Vec2Type& b) const;
60 
65  double Evaluate(const double distance) const;
66 
76  template<typename VecType>
77  double ConvolutionIntegral(const VecType& a, const VecType& b);
78 
84  double Normalizer(const size_t dimension);
85 
86  private:
88  double bandwidth;
91 };
92 
94 template<>
96 {
97  public:
99  static const bool IsNormalized = true;
100 };
101 
102 }; // namespace kernel
103 }; // namespace mlpack
104 
105 // Include implementation.
106 #include "epanechnikov_kernel_impl.hpp"
107 
108 #endif
double ConvolutionIntegral(const VecType &a, const VecType &b)
Obtains the convolution integral [integral of K(||x-a||) K(||b-x||) dx] for the two vectors...
This is a template class that can provide information about various kernels.
EpanechnikovKernel(const double bandwidth=1.0)
Instantiate the Epanechnikov kernel with the given bandwidth (default 1.0).
double inverseBandwidthSquared
Cached value of the inverse bandwidth squared (to speed up computation).
double bandwidth
Bandwidth of the kernel.
The Epanechnikov kernel, defined as.
double Normalizer(const size_t dimension)
Compute the normalizer of this Epanechnikov kernel for the given dimension.
double Evaluate(const Vec1Type &a, const Vec2Type &b) const
Evaluate the Epanechnikov kernel on the given two inputs.
static const bool IsNormalized
If true, then the kernel is normalized: K(x, x) = K(y, y) = 1 for all x.