kalepy.kernels

Kernal basis functions for KDE calculations, used by kalepy.kde.KDE class.

Contents:

class kalepy.kernels.Box_Asym

Bases: kalepy.kernels.Distribution

classmethod cdf(xx)
classmethod inside(points)
class kalepy.kernels.Distribution

Bases: object

Distribution positional arguments (xx or yy) must be shaped as (D, N) for ‘D’ dimensions and ‘N’ data-points.

property FINITE
property SYMMETRIC
__init__()

Initialize self. See help(type(self)) for accurate signature.

cdf(xx)
property cdf_grid
classmethod evaluate(xx)
classmethod grid(edges, **kwargs)
classmethod inside(points)
classmethod name()
ppf(cd)

Percentile Point Function - the inverse of the cumulative distribution function.

NOTE: for symmetric kernels, this (effectively) uses points only with cdf in [0.0, 0.5], which produces better numerical results (unclear why).

sample(size, ndim=None, squeeze=None)
class kalepy.kernels.Gaussian

Bases: kalepy.kernels.Distribution

cdf(yy)
classmethod inside(points)
classmethod norm(ndim=1)
class kalepy.kernels.Kernel(distribution=None, bandwidth=None, covariance=None, helper=False, chunk=100000.0)

Bases: object

property FINITE
__init__(distribution=None, bandwidth=None, covariance=None, helper=False, chunk=100000.0)

Initialize self. See help(type(self)) for accurate signature.

property bandwidth
property covariance
density(points, data, weights=None, reflect=None, params=None)

Calculate the Density Function using this Kernel.

Parameters

points ((D, N), 2darray of float,) – N points at which to evaluate the density function over D parameters (dimensions). Locations must be specified for each dimension of the data, or for each of target params dimensions of the data.

property distribution
property matrix
property matrix_inv
property norm
resample(data, weights=None, size=None, keep=None, reflect=None, squeeze=True)
class kalepy.kernels.Parabola

Bases: kalepy.kernels.Distribution

classmethod cdf(xx)
kalepy.kernels.get_all_distribution_classes()
kalepy.kernels.get_distribution_class(arg=None)