statsmodels.nonparametric.kernels_asymmetric.pdf_kernel_asym(x, sample, bw, kernel_type, weights=None, batch_size=10)[source]

Density estimate based on asymmetric kernel.

xarray_like, float

Points for which density is evaluated. x can be scalar or 1-dim.

samplendarray, 1-d

Sample from which kernel estimate is computed.


Bandwidth parameter, there is currently no default value for it.

kernel_typestr or callable

Kernel name or kernel function. Currently supported kernel names are “beta”, “beta2”, “gamma”, “gamma2”, “bs”, “invgamma”, “invgauss”, “lognorm”, “recipinvgauss” and “weibull”.

weightsNone or ndarray

If weights is not None, then kernel for sample points are weighted by it. No weights corresponds to uniform weighting of each component with 1 / nobs, where nobs is the size of sample.


If x is an 1-dim array, then points can be evaluated in vectorized form. To limit the amount of memory, a loop can work in batches. The number of batches is determined so that the intermediate array sizes are limited by

np.size(batch) * len(sample) < batch_size * 1000.

Default is to have at most 10000 elements in intermediate arrays.

pdffloat or ndarray

Estimate of pdf at points x. pdf has the same size or shape as x.