OrdinalEntropyEstimator

OrdinalEntropyEstimator#

class infomeasure.estimators.entropy.OrdinalEntropyEstimator(*data, embedding_dim: int, step_size: int = 1, stable: bool = False, base: int | float | str = 'e')[source]

Bases: EntropyEstimator

Estimator for the Ordinal / Permutation entropy.

The Ordinal entropy is a measure of the complexity of a time series. The input data needs to be comparable, i.e., the data should be ordinal, as the relative frequencies are calculated. For a given embedding_dim (length of considered subsequences), all \(n!\) possible permutations are considered and their relative frequencies are calculated [BP02].

Embedding delay is not supported natively.

Attributes:
*dataarray_like

The data used to estimate the entropy.

embedding_dimint

The size of the permutation patterns.

step_sizeint, optional

The step size for the sliding windows (delay). Default is 1.

stablebool, optional

If True, when sorting the data, the embedding_dim of equal elements is preserved. This can be useful for reproducibility and testing, but might be slower.

Raises:
ValueError

If the embedding_dim is negative or not an integer.

ValueError

If the embedding_dim is too large for the given data.

TypeError

If the data are not 1d array-like(s).

Notes

  • The ordinality will be determined via numpy.argsort().

  • If embedding_dim is set to 1, the entropy is always 0.