KernelDensityEstimator

Struct KernelDensityEstimator 

Source
pub struct KernelDensityEstimator<C>(pub C);
Expand description

Kernel density estimator.

It is used to model «good» and «bad» parameter distributions, but can also be used standalone.

§Type parameters

  • [C]: iterator of KDE’s components that are Density and Sample.

Tuple Fields§

§0: C

Trait Implementations§

Source§

impl<C: Clone> Clone for KernelDensityEstimator<C>

Source§

fn clone(&self) -> KernelDensityEstimator<C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug> Debug for KernelDensityEstimator<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Ks> Density for KernelDensityEstimator<Ks>
where Ks: Iterator + Clone, Ks::Item: Density, <<Ks as Iterator>::Item as Density>::Param: Copy, <<Ks as Iterator>::Item as Density>::Output: SelfAdd + SelfDiv + FromPrimitive + Zero,

Source§

fn density(&self, at: Self::Param) -> Self::Output

Calculate the KDE’s density at the specified point.

The method returns [P::zero()], if there are no components.

Source§

type Param = <<Ks as Iterator>::Item as Density>::Param

Parameter type.
Source§

type Output = <<Ks as Iterator>::Item as Density>::Output

Output density value type.
Source§

impl<Ks> Sample for KernelDensityEstimator<Ks>
where Ks: Iterator + Clone, Ks::Item: Sample,

Source§

fn sample(&self, rng: &mut Rng) -> Self::Param

Sample a random point from the KDE.

The algorithm uses «reservoir sampling» to pick a random component, and then samples a point from that component.

The method returns None, if the estimator has no components.

Source§

type Param = Option<<<Ks as Iterator>::Item as Sample>::Param>

Sampled value type. Read more
Source§

impl<C: Copy> Copy for KernelDensityEstimator<C>

Auto Trait Implementations§

§

impl<C> Freeze for KernelDensityEstimator<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for KernelDensityEstimator<C>
where C: RefUnwindSafe,

§

impl<C> Send for KernelDensityEstimator<C>
where C: Send,

§

impl<C> Sync for KernelDensityEstimator<C>
where C: Sync,

§

impl<C> Unpin for KernelDensityEstimator<C>
where C: Unpin,

§

impl<C> UnwindSafe for KernelDensityEstimator<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.