The statistics of macaw_data's package (spec/04 §5), each an aggregate
(Macaw.Data.Aggregate) ported from visualize's Visualize.Data:
| Name | Value | Of no readings | Output type | Unit |
|---|---|---|---|---|
count | the number of readings | 0 | :number | dropped |
distinct | the number of distinct readings (===, a category by spelling) | 0 | :number | dropped |
min, max | the least, the greatest reading, numbers or times | nil | the input's | kept |
extent | [min, max] | nil | :term | kept |
sum | the sum of numbers | 0 | :number | kept |
mean | the arithmetic mean | nil | :number | kept |
median | the middle reading, or the mean of the two middles | nil | :number | kept |
quantile | linear interpolation at (n − 1) · p | nil | :number | kept |
variance | the sample variance | nil, and of one | :number | dropped |
deviation | its square root | nil, and of one | :number | kept |
slope | the least-squares slope; a number is the point [i, v] | nil, of one, or every x equal | :number | dropped |
delta | the last reading minus the first | nil (0 of one) | :number | kept |
The readings come with every nil dropped. A reading of the wrong kind raises
ArgumentError naming the aggregate and the reading. Every statistic but median and
quantile has the streaming form, and its reduce/2 is that form folded over the
readings, so the two are equal by construction: the mean is a running sum over a count,
the variance and the slope Welford's one-pass updates, which agree with visualize's
two-pass values to within floating-point rounding.
Summary
Functions
@spec all() :: [module()]
The modules of the thirteen statistics, in spec/04 §5's order.