# 1D Kernel Density Plot

This node plots a 1D Kernel density function based on an incoming data table

## Kernel Estimators

A variety of kernel estimators are available, as shown in the table:

NameFunction
UNIFORMK(u) = 0.5 (|u| ≤ 1), 0 (|u) > 1); aka 'Uniform' or 'Boxcar'
TRIANGLEK(u) = 1-|u| (|u| ≤ 1), 0 (|u) > 1)
EPANECHNIKOVK(u) = 3•(1-u²)/4 (|u| ≤ 1), 0 (|u) > 1)
QUARTICK(u) = 15•(1-u²)²/16 (|u| ≤ 1), 0 (|u) > 1)
TRIWEIGHTK(u) = 35•(1-u²)³/32 (|u| ≤ 1), 0 (|u) > 1)
TRICUBEK(u) = 70•(1-|u|³)³/81 (|u| ≤ 1), 0 (|u) > 1)
GAUSSIANK(u) = e^(-u²/2) / √(2π)
COSINUSK(u) = (π/4)•cos(πu/2) (|u| ≤ 1), 0 (|u) > 1)
LOGISTICK(u) = 1/(e^u + 2 + e^-u)
SIGMOIDK(u) = 2/(π•(e^u + e^-u))
SILVERMANK(u) = 0.5•e^(-|u|/√2)•sin((|u|/√2) + (π/4))

## Bandwidth estimation

The bandwidth effects the 'smoothness' of the kernel density function. There are a number of methods to automatically guess a suitable bandwidth. In this node we only offer three options, as shown in the table below. For further details see the Wikipedia Multivariate Kernel Density estimation page.

The methods offered are:

NameFunction
SilvermanBandwidth is estimated using the Silverman approximation (H = stdDev * [4 / ((d + 2) * n)]^(1 / (d + 4)), where d is thenumber of dimensions and n the number of datapoints)
ScottBandwidth is estimated using the Scott approximation (H = stdDev / n^(1 / (d + 4)), where d is thenumber of dimensions and n the number of datapoints)
User DefinedThe user specifies the bandwidth (H)
All methods are for a constant bandwidth across the whole data series

## Options

#### Kernel Options

Values Column
The column in the incoming table containing the values from which to generate the kernel(s)
Grouping Column
An optional grouping column, to generate separate kernels for each series
Show all-data kernel
If a grouping column is selected, this option allows an additional kernel to be shown, which includes the entire data column, including those rows where the grouping column contains a missing value
Kernel Estimator
The Kernel function to apply at each data point. See above for details of the individual kernel estimators
Values Column Bandwidth
The bandwidth estimation method to used for the dataset. See above for details
Bandwidth (H)
User-defined bandwidth
Number of grid points along axis
The number of grid points to calculate the kernel density function value for
Expand all kernels to whole range
If a grouping column is selected, this option allows all kernel density functions to be calculated over the full range of the plot when axis autoranging is selected
Auto-range x-Axis
Should the x-Axis range be calculated automatically? If so, it will be extended beyond the most extreme values by 5% of the range between them.
x-Axis Range
The manual axis range
Show legend
If a grouping column is selected, this option shows a legend for the colours of the individual kernels on the plot. The colours will be derived from a color manager applied to the grouping column, or generated dynamically if there isnt an appropriate color manager
Show bandwidth (H) on axis label or legend
Should the bandwidth be shown on the axis label (or in the legend if a grouping column is selected)?

#### General Plot Options

Type of Image
The type of the created image can either be png or svg. PNGs are mostly smaller, SVGs provide details about plot and the possibility to be changed individually
Title of Graph
The title of the graph shown above the generated image. If the title is not activated, no title will be shown
Width of Image (in pixel)
The width of the generated image, not the plot width
Height of Image (in pixel)
The height of the generated image, not the plot height
Background Colour
The color of the background of the plot. Hence this color is used for the empty space in a plot
Plot background Alpha
The transparency of the plot background can be modified using an additional alpha value. An alpha value of 1 does not change the background transparency. Decreasing the alpha value will increase the plot background transparency
Scale Font Size
Factor changes the font sizes within the JFreeChart view. A value greater the 1 increases all view fonts, a value between 0 and 1 decrease them

## Views

1D Kernel Density Plot
View showing the 1D Kernel Density Plot