Trait Kernel

Source
pub trait Kernel {
    type Param;

    // Required method
    fn new(location: Self::Param, std: Self::Param) -> Self;
}
Expand description

A single kernel of a kernel density estimator.

Note that it does not directly correspond to the mathematical definition, as for example, it is responsible for its own shift and scaling. This is useful for discrete kernels which do not normally have a bandwidth parameter h.

Required Associated Types§

Required Methods§

Source

fn new(location: Self::Param, std: Self::Param) -> Self

Construct a kernel with the given location and bandwidth.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P, D> Kernel for Binomial<P, D>
where Self: Density<Param = P, Output = D> + Sample<Param = P>, P: Copy + Ord + Additive + Multiplicative + Into<D> + One, D: Multiplicative,

Source§

type Param = P

Source§

impl<P, D> Kernel for Uniform<P, D>
where Self: Density<Param = P, Output = D> + Sample<Param = P>, P: Copy + SelfAdd + SelfMul + PartialOrd + Zero + ConstSqrt3 + SelfNeg + SelfMulAdd,

Source§

type Param = P

Source§

impl<T> Kernel for Epanechnikov<T>
where Self: Density<Param = T, Output = T> + Sample<Param = T>, T: PartialOrd + Zero,

Source§

type Param = T

Source§

impl<T> Kernel for Gaussian<T>
where Self: Density<Param = T, Output = T> + Sample<Param = T>, T: PartialOrd + Zero,

Source§

type Param = T