floodlight.io.entropy

floodlight.metrics.entropy.approx_entropy(sig, m=2, r=0.5)[source]

Calculates the Approximate Entropy ApEn(m,r) of sig according to Pincus (1991). 1

Parameters
  • sig (np.array) – A time-series as np.ndarray with a single dimension (sig.ndim == 1).

  • m (int, optional) – Comparison length of runs. Typically, m in {2,3}. Defaults to 2.

  • r (float, optional) – Filtering level. Defaults to 0.5.

Returns

ApEn – The Approximate Entropy of sig.

Return type

float

Notes

Time-series must be taken at equally spaced time points. Lower bound according to Pincus, Gladstone, Ehrenkranz (1991) is 50 time points 2. The filtering level r should be at least three times larger in magnitude as the noise.

Rule of thumb: 0.1-0.25 of data STD.

References

1

Pincus, S. M. (1991). Approximate entropy as a measure of system complexity. Proceedings of the National Academy of Sciences, 88(6), 2297-2301.

2

Pincus, S. M., Gladstone, I. M., & Ehrenkranz, R. A. (1991). A regularity statistic for medical data analysis. Journal of clinical monitoring, 7(4), 335-345.