statsmodels.nonparametric.kernels_asymmetric.cdf_kernel_asym#

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

Estimate of cumulative distribution based on asymmetric kernel

Parameters:
xfloat or array_like

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

samplearray_like

1-d sample from which kernel estimate is computed.

bwfloat

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 array_like, optional

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.

batch_sizefloat, optional

If x is an 1-dim array, then points can be evaluated in vectorized form. To limit the amount of memory, a loop works in batches. Evaluation points and sample points are split so that the intermediate kernel arrays have at most batch_size * 1000 elements. The value does not need to be an integer.

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

Changed in version 0.15.1: batch_size bounds the size of the intermediate kernel arrays on both axes, the evaluation points and the sample. Previously a sample with more than batch_size * 1000 observations raised an error. A single-element x now always returns a scalar.

Returns:
cdffloat or ndarray

Estimate of cdf at points x. A float is returned if x is a scalar or has a single element, otherwise an ndarray with one entry for each element of x.

Raises:
TypeError

If batch_size is not a number, for example None, a str or a bool.

ValueError

If batch_size * 1000 is smaller than 1 or is nan.