Macaw.Data.Operations.Aggregates (macaw_data v0.12.0)

View Source

The statistics of macaw_data's package (spec/04 §5), each an aggregate (Macaw.Data.Aggregate) ported from visualize's Visualize.Data:

NameValueOf no readingsOutput typeUnit
countthe number of readings0:numberdropped
distinctthe number of distinct readings (===, a category by spelling)0:numberdropped
min, maxthe least, the greatest reading, numbers or times of any kindsnilthe input'skept
extent[min, max]nil:termkept
sumthe sum of numbers0:numberkept
meanthe arithmetic meannil:numberkept
medianthe middle reading, or the mean of the two middlesnil:numberkept
quantilelinear interpolation at (n − 1) · pnil:numberkept
variancethe sample variancenil, and of one:numberdropped
deviationits square rootnil, and of one:numberkept
slopethe least-squares slope; a number is the point [i, v]nil, of one, or every x equal:numberdropped
deltathe last reading minus the firstnil (0 of one):numberkept

The readings come with every nil dropped. min, max and extent order times of any kinds together, as instants on one scale (Macaw.Data.Window.compare/2), and answer the reading itself, of its own kind; of two at one instant, the first (macaw_data#141). A reading of the wrong kind is refused before the fold, by what each statistic reads/0 (spec/04 §5): Macaw.Data.Operations.aggregate/4 answers {["values"], {:reads, kind}}, and the step naming it refuses the column the same way. 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

The modules of the thirteen statistics, in spec/04 §5's order.

Functions

all()

@spec all() :: [module()]

The modules of the thirteen statistics, in spec/04 §5's order.