A density
transformation converts a variable into an estimated kernel density using Vega’s density transform (see this documentation), resulting in a density distribution
Density
properties
Property | Type | Description |
---|---|---|
density |
String |
(Required) A variable name to estimate the density |
groupby |
Array[String] |
(Optinal) The names of variables to group items by. |
cumulative |
Boolean |
(Optinal, default: false ) Whether to compute cumulative density or probability density. |
counts |
Boolean |
(Optinal, default: false ) Whether to compute probabilty density (sum to 1) or count-wise density (actual counts, not sum to 1). |
bandwidth |
Number |
(Optinal) The kernel’s bandwidth. If not provided, it’s automatically estimated |
extent |
Array[Number, length=2] |
(Optinal) A [min, max] range for the kernel density estimation. |
minsteps |
Number |
(Optinal, default: 25 ) The minimum number of sampled values. |
maxsteps |
Number |
(Optinal, default: 200 ) The maximum number of sampled values. |
steps |
Number |
(Optinal) The exact number of sampled values |
as |
Array[String, length=2] |
(Optional, default: ['value', 'density'] ) The new field names for the estimation. |