dist_kde
dist_kde(data, kernel='Gaussian', bandwidth=None, bounded_by_data=True)Kernel density distribution.
A nonparametric density estimate built from a sample by summing a kernel centered at each observation. Mirrors the C# KernelDensity composite.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| data | array-like of float | Observations the density is built from. | required |
| kernel | ('Gaussian', 'Epanechnikov', 'Triangular', 'Uniform') | The kernel shape. | "Gaussian" |
| bandwidth | float | The kernel bandwidth; None (the default) uses Silverman’s rule of thumb. |
None |
| bounded_by_data | bool | Whether the reported minimum and maximum are the smallest and largest observation (True, the default) or extend three bandwidths past each. Those bounds gate Distribution.cdf() and Distribution.quantile(). The density is summed wherever you ask it, either way. |
True |
Returns
| Name | Type | Description |
|---|---|---|
| Distribution | Family "KernelDensity", accepted by every method every other :class:Distribution accepts. |
Examples
>>> d = dist_kde([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
>>> d.cdf(5.5)
0.5