Macaw.Data.Operations.Aggregates.Box (macaw_data v0.21.1)

View Source

box: a box plot's summary of numbers, %{q1, median, q3, low, high, outliers} (spec/04 §5). The quartiles are quantile's at 0.25, 0.5 and 0.75. The fences lie whisker IQRs (q3 − q1) beyond the box: low and high are the least and the greatest readings within them, and outliers the readings beyond them, in the readings' order. A fence past a float's range bounds no reading. It needs every reading, so it has no streaming form.

Summary

Functions

The fences of the readings, {below, above}, each :overflow when it is past a float's range and so bounds none; nil of no readings; {:error, :overflow} for a quartile past the range. outliers keeps the rows whose reading lies beyond them.

Whether a reading lies beyond the fences fences/2 answers.

The summary a step writes as five float columns (spec/04 §4.10): {q1, median, q3, low, high}, low and high nil when no reading is within the fences; nil of no readings; {:error, :overflow} for a quartile past a float's range.

Functions

fences(values, arg2)

@spec fences([number()], map()) ::
  {number() | :overflow, number() | :overflow} | nil | {:error, :overflow}

The fences of the readings, {below, above}, each :overflow when it is past a float's range and so bounds none; nil of no readings; {:error, :overflow} for a quartile past the range. outliers keeps the rows whose reading lies beyond them.

outlier?(value, fences)

@spec outlier?(
  number(),
  {number() | :overflow, number() | :overflow}
) :: boolean()

Whether a reading lies beyond the fences fences/2 answers.

summary(values, options)

The summary a step writes as five float columns (spec/04 §4.10): {q1, median, q3, low, high}, low and high nil when no reading is within the fences; nil of no readings; {:error, :overflow} for a quartile past a float's range.