pyhctsa.operations.entropy.permutation_entropy¶
-
pyhctsa.operations.entropy.permutation_entropy(y, m=
2, tau=1)¶ Permutation Entropy (PermEn) of a time series.
Computes the permutation entropy and its normalised version for a given time series, as described in [1], along with a weighted permutation entropy [2] and a measure of the time-reversal asymmetry of the ordinal patterns.
The ordinal patterns are ranked as in hctsa’s EN_PermEn (BF_OrdinalPatternRank).
The
permEnLEoutput follows the adapted implementation of permutation entropy by Bruce Land and Damian Elias (Cornell University; https://people.ece.cornell.edu/land/PROJECTS/Complexity/), as in hctsa’sEN_PermEn.References
- Parameters:¶
- y : array-like¶
Input time series.
- m : int, optional¶
Embedding dimension (order of the permutation entropy). Default is 2.
- tau : int or str, optional¶
Time-delay for the embedding: an integer, or a rule understood by
get_tau():'ac'(first zero-crossing of the autocorrelation function),'ac1e'(floor of its first 1/e crossing) or'mi'(the smaller of the first minimum of the Kraskov automutual information and the'ac1e'delay). All outputs are NaN if the delay cannot be determined (e.g., a constant series). Default is 1.
- Returns:¶
A dictionary containing:
’permEn’: the permutation entropy (bits),
’normPermEn’: permEn normalized by log2(m!),
’permEnLE’: the permutation entropy of Bandt and Pompe with patterns of probability below 1/N floored at 1/N (natural log, divided by m - 1),
’normWPE’: the weighted permutation entropy normalized by log2(m!) (pattern probabilities are the sums of the variances of the m values of the embedding vectors with that pattern; NaN if all vectors are constant),
’ordAsym’: the total variation distance between the distribution of ordinal patterns of the series and that of the same embedding vectors read backward (0 for a time-reversible pattern distribution).
- Return type:¶
dict