statsmodels.nonparametric.bandwidths.bw_silverman

statsmodels.nonparametric.bandwidths.bw_silverman(x, kernel=None)[source]

Silverman’s Rule of Thumb

Parameters:
xarray_like

Array for which to get the bandwidth

kernelCustomKernel object

Unused

Returns:
bwfloat

The estimate of the bandwidth

Notes

Returns .9 * A * n ** (-1/5.) where

A = min(std(x, ddof=1), IQR/1.349)
IQR = np.subtract.reduce(np.percentile(x, [75,25]))

References

Silverman, B.W. (1986) Density Estimation.


Last update: Oct 03, 2024