Struct rolling_stats::Stats

source ·
pub struct Stats<T: Float + Zero + One + AddAssign + FromPrimitive + PartialEq + Debug> {
    pub min: T,
    pub max: T,
    pub mean: T,
    pub std_dev: T,
    pub count: usize,
    /* private fields */
}
Expand description

Stats object calculates continuous min/max/mean/deviation for tracking of time varying statistics.

See: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford’s_Online_algorithm for Details of the underlying algorithm.

Fields§

§min: T

Minimum value

§max: T

Maximum value

§mean: T

Mean of sample set

§std_dev: T

Standard deviation of sample

§count: usize

Number of values collected

Implementations§

Create a new stats object

Update the stats object

Merge a set of stats objects for analysis This performs a weighted averaging across the provided stats object, the output object should not be updated further.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.