mlpack  1.0.12
epanechnikov_kernel.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_CORE_KERNELS_EPANECHNIKOV_KERNEL_HPP
15 #define __MLPACK_CORE_KERNELS_EPANECHNIKOV_KERNEL_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace kernel {
21 
32 {
33  public:
39  EpanechnikovKernel(const double bandwidth = 1.0) :
42  { }
43 
50  template<typename Vec1Type, typename Vec2Type>
51  double Evaluate(const Vec1Type& a, const Vec2Type& b) const;
52 
57  double Evaluate(const double distance) const;
58 
69  template<typename VecType>
70  double ConvolutionIntegral(const VecType& a, const VecType& b);
71 
77  double Normalizer(const size_t dimension);
78 
79  // Returns String of O bject
80  std::string ToString() const;
81 
82  private:
84  double bandwidth;
87 
88 };
89 
91 template<>
93 {
94  public:
96  static const bool IsNormalized = true;
97 };
98 
99 }; // namespace kernel
100 }; // namespace mlpack
101 
102 // Include implementation.
103 #include "epanechnikov_kernel_impl.hpp"
104 
105 #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:23
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.