Loess Transform

The loess transform ≥ 5.4 (for locally-estimated scatterplot smoothing) uses locally-estimated regression to produce a trend line. Loess performs a sequence of local weighted regressions over a sliding window of nearest-neighbor points. For standard parametric regression options, see the regression transform.

Transform Parameters

Property Type Description
x Field Required. The data field for predictor (independent) values, typically associated with the x-axis.
y Field Required. The data field for predicted (dependent) values, typically associated with the y-axis.
groupby Field[ ] The data fields to group by. If not specified, a single group containing all data objects will be used.
bandwidth Number The bandwidth parameter for the loess method (default 0.3).
as String The output fields for the predictor and predicted values for the line of best fit. If unspecified, the x and y parameter field names will be used.

Usage

Generate a loess trend line that models the field dv as a function of iv, using a bandwidth parameter of 0.2:

{
  "type": "regression",
  "method": "loess",
  "x": "dv",
  "y": "iv",
  "bandwidth": 0.2
}

Generates a new data stream with points for a trend line that can then be visualized with a line mark.