Skip to main content

Module density

Module density 

Source
Expand description

Kernel density estimation (KDE) with a Gaussian kernel.

Estimates a continuous probability density from a one-dimensional sample by summing a Gaussian bump over every observation. The kernel bandwidth follows Scott’s rule with the same covariance factor scipy.stats.gaussian_kde uses (factor = n^(−1/5) in one dimension, bandwidth² = factor² · var(data, ddof=1)), so the estimate reproduces scipy’s gaussian_kde to machine precision. This base block backs the DensityEstimation computational method.

Structs§

GaussianKde
A fitted Gaussian kernel density estimator over a one-dimensional sample.

Enums§

DensityError
Errors that prevent a Gaussian KDE from being fitted.

Functions§

gaussian_kde
Fits a Gaussian kernel density estimator to the one-dimensional data.