MLPACK  1.0.11
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 
77  template<typename VecType>
78  double ConvolutionIntegral(const VecType& a, const VecType& b);
79 
85  double Normalizer(const size_t dimension);
86 
87  // Returns String of O bject
88  std::string ToString() const;
89 
90  private:
92  double bandwidth;
95 
96 };
97 
99 template<>
101 {
102  public:
104  static const bool IsNormalized = true;
105 };
106 
107 }; // namespace kernel
108 }; // namespace mlpack
109 
110 // Include implementation.
111 #include "epanechnikov_kernel_impl.hpp"
112 
113 #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.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:31
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.