floodlight.metrics.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