kernelDensityEstimation
kernelDensityEstimation(
X,kernel,bandwidthMethod):Function
Defined in: src/kernel_density_estimation.js:52
Kernel density estimation is a useful tool for, among other things, estimating the shape of the underlying probability distribution from a sample.
Parameters
Section titled “Parameters”any
sample values
kernel
Section titled “kernel”any
The kernel function to use. If a function is provided, it should return non-negative values and integrate to 1. Defaults to ‘gaussian’.
bandwidthMethod
Section titled “bandwidthMethod”any
The “bandwidth selection” method to use, or a fixed bandwidth value. Defaults to “nrd”, the commonly-used “normal reference distribution” rule-of-thumb.
Returns
Section titled “Returns”Function
An estimated probability density function for the given sample. The returned function runs in O(X.length).
