pyhctsa.operations.distribution.fit_kernel_smooth

pyhctsa.operations.distribution.fit_kernel_smooth(x, area=None, numcross=None, arclength=None)

Statistics of a kernel-smoothed distribution of the data.

The data are smoothed with a Gaussian kernel with Silverman’s normal-reference bandwidth using a robust (median absolute deviation) scale estimate (pyhctsa.robust.bf_ks_density(): 100 points from three bandwidths below the minimum to three above the maximum) and the smoothed density, f, is summarized by its number of peaks, maximum, entropy, and asymmetry about the mean, plus optional threshold-based statistics.

Parameters:
x : array-like

The input data vector.

area : float or list of float, optional

Thresholds for which to compute the integral of f over the region where f is below the threshold.

numcross : float or list of float, optional

Thresholds for which to count the crossings of f through the threshold.

arclength : float or list of float, optional

Half-widths of a window around the mean; the arc length (total absolute change in f) within the window is computed.

Returns:

npeaks: the number of ‘large enough’ maxima of f (those with second difference below -0.0002); max: the maximum of f; entropy: the entropy of f; asym: the area of f above the mean divided by that below it (NaN if there is essentially none below); plsym: the ratio of the total variation of f below the mean to that above it (NaN if there is none above); and, for each threshold t, numcross_t, area_t, arclength_t (t formatted to two decimals with the dot removed, e.g. numcross_005 for 0.05). NaN (not a dict) for a constant series, which has no scale to smooth over.

Return type:

dict