pub enum KdeBandwidthMethod {
Scott,
Silverman,
Scalar(f64),
}Expand description
Bandwidth selection rule for 1-D Gaussian Kernel Density Estimation,
matching scipy.stats.gaussian_kde (pandas.Series.plot.kde / DataFrame.plot.kde).
Variants§
Scott
Scott’s Rule (pandas / scipy.stats.gaussian_kde default):
factor = n**(-1 / (d + 4)) = n**(-0.2) in 1-D, h = factor * std(ddof=1).
Silverman
Silverman’s Rule (bw_method="silverman" in scipy.stats.gaussian_kde):
factor = (n * (d + 2) / 4)**(-1 / (d + 4)) = (0.75 * n)**(-0.2) in 1-D,
h = factor * std(ddof=1).
Scalar(f64)
Explicit scalar covariance factor (bw_method=<float> in scipy.stats.gaussian_kde):
factor = c, h = c * std(ddof=1).
Implementations§
Source§impl KdeBandwidthMethod
impl KdeBandwidthMethod
Sourcepub fn parse_str(method: &str) -> Result<Self, FrameError>
pub fn parse_str(method: &str) -> Result<Self, FrameError>
Parse a pandas/scipy bw_method string ("scott" or "silverman").
Sourcepub fn from_scalar(factor: f64) -> Result<Self, FrameError>
pub fn from_scalar(factor: f64) -> Result<Self, FrameError>
Construct an explicit scalar covariance factor (bw_method=<float>).
Sourcepub fn covariance_factor_1d(self, n: usize) -> Result<f64, FrameError>
pub fn covariance_factor_1d(self, n: usize) -> Result<f64, FrameError>
Compute the 1-D scipy.stats.gaussian_kde covariance factor for sample size n.
Trait Implementations§
Source§impl Clone for KdeBandwidthMethod
impl Clone for KdeBandwidthMethod
impl Copy for KdeBandwidthMethod
Source§impl Debug for KdeBandwidthMethod
impl Debug for KdeBandwidthMethod
Source§impl Default for KdeBandwidthMethod
impl Default for KdeBandwidthMethod
Source§impl PartialEq for KdeBandwidthMethod
impl PartialEq for KdeBandwidthMethod
impl StructuralPartialEq for KdeBandwidthMethod
Auto Trait Implementations§
impl Forget for KdeBandwidthMethod
impl Freeze for KdeBandwidthMethod
impl Move for KdeBandwidthMethod
impl RefUnwindSafe for KdeBandwidthMethod
impl Send for KdeBandwidthMethod
impl Sync for KdeBandwidthMethod
impl Unpin for KdeBandwidthMethod
impl UnsafeUnpin for KdeBandwidthMethod
impl UnwindSafe for KdeBandwidthMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more