conkit.misc.bandwidth module

A collection of bandwidth estimators for Kernel Density Estimation

class AmiseBW(data, niterations=25, eps=0.001)[source]

Bases: conkit.misc.bandwidth.BandwidthBase

Asymptotic Mean Integrated Squared Error (AMISE)

This particular choice of bandwidth recovers all the important features whilst maintaining smoothness. It is a direct implementation of the method used by [1].

[1]Sadowski, M.I. (2013). Prediction of protein domain boundaries from inverse covariances.

Attributes

bandwidth
bw

Methods

curvature(p, x, w)
extended_range(mn, mx, bw[, ext])
optimal_bandwidth_equation(p, default_bw)
stiffness_integral(p, default_bw[, eps])
bandwidth
static curvature(p, x, w)[source]
static extended_range(mn, mx, bw, ext=3)[source]
static optimal_bandwidth_equation(p, default_bw)[source]
static stiffness_integral(p, default_bw, eps=0.0001)[source]
class BandwidthBase[source]

Bases: abc.ABC

Abstract class for bandwidth calculations

Attributes

bandwidth
bw
bandwidth
bw
class BowmanBW(data)[source]

Bases: conkit.misc.bandwidth.BandwidthBase

Bowman & Azzalini [2] bandwidth calculation

\[\sqrt{\frac{\sum{X}^2}{n}-(\frac{\sum{X}}{n})^2}*(\frac{(d+2)*n}{4})^\frac{-1}{d+4}\]
[2]Bowman, A.W. & Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis.

Attributes

bandwidth
bw
bandwidth
class LinearBW(data, threshold=15)[source]

Bases: conkit.misc.bandwidth.BandwidthBase

Linear [3] implementation

\[\frac{N_{max}}{t}\]
[3]Sadowski, M.I. (2013). Prediction of protein domain boundaries from inverse covariances.

Attributes

bandwidth
bw
bandwidth
class ScottBW(data)[source]

Bases: conkit.misc.bandwidth.BandwidthBase

Scott’s [4] implementation

\[1.059*\sigma*n^\frac{-1}{d+4}\]
[4]Scott, D.W. (1992). Multivariate Density Estimation: Theory, Practice, and Visualization.

Attributes

bandwidth
bw
bandwidth
class SilvermanBW(data)[source]

Bases: conkit.misc.bandwidth.BandwidthBase

Silverman’s [5] implementation

\[0.9*\sigma*(n*\frac{d+2}{4})^\frac{-1}{d+4}\]
[5]Silverman, B.W. (1986). Density Estimation for Statistics and Data Analysis.

Attributes

bandwidth
bw
bandwidth
bandwidth_factory(method)[source]

Obtain the bandwidth as defined by user method