Module extra::stats

Traits

Stats

Trait that provides simple descriptive statistics on a univariate set of numeric samples.

Functions

freq_count

Returns a HashMap with the number of occurrences of every element in the sequence that the iterator exposes.

winsorize

Winsorize a set of samples, replacing values above the 100-pct percentile and below the pct percentile with those percentiles themselves. This is a way of minimizing the effect of outliers, at the cost of biasing the sample. It differs from trimming in that it does not change the number of samples, just changes the values of those that are outliers.

write_5_number_summary

Render writes the min, max and quartiles of the provided Summary to the provided Writer.

write_boxplot

Render a boxplot to the provided writer. The boxplot shows the min, max and quartiles of the provided Summary (thus includes the mean) and is scaled to display within the range of the nearest multiple-of-a-power-of-ten above and below the min and max of possible values, and target width_hint characters of display (though it will be wider if necessary).