pyhctsa.operations.entropy.distribution_entropy

pyhctsa.operations.entropy.distribution_entropy(y, hist_or_ks='hist', num_bins=10, olremp=0)

Distributional entropy.

Estimates entropy from the distribution of a data vector. The distribution is estimated either using a histogram with numBins bins, or as a kernel-smoothed distribution using a Gaussian kernel.

An optional additional parameter can be used to remove a proportion of the most extreme positive and negative deviations from the mean as an initial pre-processing step.

Parameters:
y : array-like

The input time series.

hist_or_ks : str

Whether to use a histogram (‘hist’) or kernel-smoothed (‘ks’) distribution.

num_bins : int or list of int, optional

  • (for ‘hist’): an integer, uses a histogram with that many bins

  • (for ‘ks’): a positive real number, for the bandwidth parameter for the kernel density estimate.

olremp : float, optional

The proportion of outliers at both extremes to remove. (e.g., if olremp = 0.01; keeps only the middle 98% of data; 0 keeps all data. This parameter ought to be less than 0.5, which keeps none of the data).

Returns:

Estimate of entropy from the distribution.

Return type:

float