Relacs Numerics Library
0.9.8
|
#include <kernel.h>
Public Member Functions | |
Kernel (void) | |
Kernel (double stdev) | |
virtual | ~Kernel (void) |
double | operator() (double x) const |
virtual double | value (double x) const |
double | scale (void) const |
virtual void | setScale (double scale) |
virtual double | mean (void) const |
virtual double | stdev (void) const |
virtual void | setStdev (double stdev) |
virtual double | max (void) const |
virtual double | left (void) const |
virtual double | right (void) const |
Base class of all kernel functions.
The width of the kernel can be controlled by a scale factor s, , via setScale() or by setting the standard deviation of the kernel via setStdev(). The actual scale factor is returned by scale() and the corresponding standard deviation by stdev(). Note that the value returned by stdev() usually differs from scale(). The mean of the kernel is mean(). The maximum value of the kernel is max().
|
inline |
Constructs a default kernel with its scale factor set to one.
|
inline |
Constructs a kernel with standard deviation stdev.
References Kernel::setStdev().
|
inlinevirtual |
Destructor.
|
inline |
Returns the value of the kernel at position x. This operator is NOT virtual in order to speed up computation when using templates. If you need a virtual function as an interface, implement value().
References Kernel::value().
Referenced by Kernel::value().
|
virtual |
Returns the value of the kernel at position x. This function IS virtual and might slow things down. If you need a NON virtual function as an interface, implement operator().
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::operator()().
Referenced by EventData::addCyclicRate(), EventData::addRate(), Kernel::max(), Kernel::mean(), Kernel::operator()(), EventData::rate(), and Kernel::stdev().
|
inline |
Return the scale factor of the kernel (the width).
Referenced by GammaKernel::GammaKernel(), GaussKernel::GaussKernel(), GaussKernel::left(), GammaKernel::mean(), RectKernel::operator()(), TriangularKernel::operator()(), GaussKernel::operator()(), GammaKernel::operator()(), GaussKernel::right(), Kernel::setScale(), RectKernel::setScale(), GaussKernel::setScale(), GammaKernel::setScale(), RectKernel::stdev(), TriangularKernel::stdev(), GaussKernel::stdev(), and GammaKernel::stdev().
|
virtual |
Set the scale factor (width) of the kernel to scale.
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::scale().
Referenced by RectKernel::setScale(), TriangularKernel::setScale(), GaussKernel::setScale(), GammaKernel::setScale(), Kernel::setStdev(), and EpanechnikovKernel::setStdev().
|
virtual |
Return the mean of the kernel. This default implementation calculates the mean numerically from 400 points between left() and right().
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::left(), Kernel::right(), and Kernel::value().
|
virtual |
Return the standard deviation of the kernel, which does not have to equal the scale(). This default implementation calculates the standard deviation numerically from 400 points between left() and right().
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::left(), Kernel::right(), relacs::sqrt(), and Kernel::value().
|
virtual |
Set the standard deviation of the kernel to stdev. This default implementation sets the scale() equal to stdev.
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::setScale().
Referenced by Kernel::Kernel().
|
virtual |
Return the maximum value of the kernel. This default implementation searches for the maximum of 400 computed function values between left() and right().
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, TriangularKernel, and RectKernel.
References Kernel::left(), Kernel::right(), and Kernel::value().
|
virtual |
The leftmost extension of the kernel. For x values less than this value, the value of the kernel is negligible. Returns minus half the scale factor.
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, and TriangularKernel.
Referenced by EventData::addCyclicRate(), EventData::addRate(), Kernel::max(), Kernel::mean(), EventData::rate(), and Kernel::stdev().
|
virtual |
The rightmost extension of the kernel. For x values greater than this value, the value of the kernel is negligible. Returns half the scale factor.
Reimplemented in GammaKernel, GaussKernel, EpanechnikovKernel, and TriangularKernel.
Referenced by EventData::addCyclicRate(), EventData::addRate(), Kernel::max(), Kernel::mean(), EventData::rate(), and Kernel::stdev().