skdh.features.SampleEntropy#
- class skdh.features.SampleEntropy(m=4, r=1.0)#
A measure of the complexity of a time-series signal. Sample entropy is a modification of approximate entropy, but has the benefit of being data-length independent and having an easier implementation. Smaller values indicate more self-similarity in the dataset, and/or less noise.
- Parameters:
- mint, optional
Set length for comparison (aka embedding dimension). Default is 4
- rfloat, optional
Maximum distance between sets. Default is 1.0
- Attributes:
- m
- r
Methods
compute(signal, *[, axis])Compute the sample entropy of a signal
Notes
Sample entropy first computes the probability that if two sets of length \(m\) simultaneous data points have distance \(<r\), then two sets of length \(m+\) simultaneous data points also have distance \(<r\), and then takes the negative natural logarithm of this probability.
\[E_{sample} = -ln\frac{A}{B}\]where \(A=`number of :math:`m+1\) vector pairs with distance \(<r\) and \(B=`number of :math:`m\) vector pairs with distance \(<r\)
The distance metric used is the Chebyshev distance, which is defined as the maximum absolute value of the sample-by-sample difference between two sets of the same length
References
- compute(signal, *, axis=-1)#
Compute the sample entropy of a signal
- Parameters:
- signalarray-like
Array-like containing values to compute the sample entropy for.
- axisint, optional
Axis along which the signal entropy will be computed. Ignored if signal is a pandas.DataFrame. Default is last (-1).
- Returns:
- samp_ennumpy.ndarray
Computed sample entropy.