pub struct Sturges<T> { /* private fields */ }
Expand description

R’s default strategy, only accounts for data size. Only optimal for gaussian data and underestimates number of bins for large non-gaussian datasets.

Let n be the number of observations. The number of bins is 1 plus the base 2 log of n. This estimator assumes normality of data and is too conservative for larger, non-normal datasets.

This is the default method in R’s hist method.

Notes

This strategy requires the data

  • not being empty
  • not being constant

Implementations

The bin width (or bin length) according to the fitted strategy.

Trait Implementations

Returns Err(BinsBuildError::Strategy) if the array is constant. Returns Err(BinsBuildError::EmptyInput) if a.len()==0. Returns Ok(Self) otherwise.

Returns a Bins instance, according to parameters inferred from observations. Read more

Returns the optimal number of bins, according to parameters inferred from observations.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.