Skip to content

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.

any

sample values

any

The kernel function to use. If a function is provided, it should return non-negative values and integrate to 1. Defaults to ‘gaussian’.

any

The “bandwidth selection” method to use, or a fixed bandwidth value. Defaults to “nrd”, the commonly-used “normal reference distribution” rule-of-thumb.

Function

An estimated probability density function for the given sample. The returned function runs in O(X.length).