Macaw.Data.Operations.Transforms.Density (macaw_data v0.21.1)

View Source

density (spec/04 §4.12): a kernel density estimate of field's readings, nils dropped, at n evenly spaced points over their extent or the extent given, one row a point, as's two columns holding the point and its density. With by, one estimate a group, in order of first appearance, each over its own readings, extent and bandwidth, for a violin or a ridgeline per category.

The kernel is gaussian or epanechnikov, the bandwidth bandwidth, else Scott's normal reference rule over the group's readings: 1.06 · min(σ, IQR / 1.34) · n^(−1/5), falling back to σ, then |q1|, then 1 where that is zero.