pyhctsa.operations.entropy.shannon_entropy

pyhctsa.operations.entropy.shannon_entropy(y, num_bins=2, depth=3)

Approximate Shannon entropy of a time series.

Uses a num_bins-bin encoding and depth-symbol sequences. Uniform population binning is used, and the implementation uses Michael Small’s code MS_shannon.c.

In this wrapper function, you can evaluate the code at a given n and d, and also across a range of depth and num_bins to return statistics on how the obtained entropies change.

References

Parameters:
y : array-like

The input time series.

num_bins : int or list of int, optional

The number of bins to discretize the time series into (i.e., alphabet size).

depth : int or list of int, optional

The length of strings to analyze.

Returns:

The normalized Shannon entropy for a given setting, or summary statistics (max, min, median, mean, std) across a range of numBins or depths.

Return type:

float or dict or None