OrdinalEntropyEstimator#
- class infomeasure.estimators.entropy.OrdinalEntropyEstimator(*data, embedding_dim: int, step_size: int = 1, stable: bool = False, base: int | float | str = 'e')[source]
Bases:
EntropyEstimatorEstimator 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_dim
int The size of the permutation patterns.
- step_size
int,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:
ValueErrorIf the
embedding_dimis negative or not an integer.ValueErrorIf the
embedding_dimis too large for the given data.TypeErrorIf the data are not 1d array-like(s).
Notes
The ordinality will be determined via
numpy.argsort().If
embedding_dimis set to 1, the entropy is always 0.