jax.scipy.stats.gaussian_kde

jax.scipy.stats.gaussian_kde#

class jax.scipy.stats.gaussian_kde(dataset, bw_method=None, weights=None)[source]#

Representation of a kernel-density estimate using Gaussian kernels.

LAX-backend implementation of scipy.stats._kde.gaussian_kde().

Original docstring below.

Kernel density estimation is a way to estimate the probability density function (PDF) of a random variable in a non-parametric way. gaussian_kde works for both uni-variate and multi-variate data. It includes automatic bandwidth determination. The estimation works best for a unimodal distribution; bimodal or multi-modal distributions tend to be oversmoothed.

Parameters:
  • dataset (array_like) – Datapoints to estimate from. In case of univariate data this is a 1-D array, otherwise a 2-D array with shape (# of dims, # of data).

  • bw_method (str, scalar or callable, optional) – The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If a scalar, this will be used directly as kde.factor. If a callable, it should take a gaussian_kde instance as only parameter and return a scalar. If None (default), ‘scott’ is used. See Notes for more details.

  • weights (array_like, optional) – weights of datapoints. This must be the same shape as dataset. If None (default), the samples are assumed to be equally weighted

References

__init__(dataset, bw_method=None, weights=None)[source]#

Methods

__init__(dataset[, bw_method, weights])

evaluate(points)

Evaluate the estimated pdf on a set of points.

integrate_box(low_bounds, high_bounds[, maxpts])

This method is not implemented in the JAX interface.

integrate_box_1d(low, high)

Computes the integral of a 1D pdf between two bounds.

integrate_gaussian(mean, cov)

Multiply estimated density by a multivariate Gaussian and integrate

integrate_kde(other)

Computes the integral of the product of this kernel density estimate

logpdf(x)

Evaluate the log of the estimated pdf on a provided set of points.

pdf(x)

Evaluate the estimated pdf on a provided set of points.

resample(key[, shape])

Randomly sample a dataset from the estimated pdf

set_bandwidth([bw_method])

This method is not implemented in the JAX interface.

tree_flatten()

tree_unflatten(aux_data, children)

Attributes

d

n

neff

dataset

weights

covariance

inv_cov