pyhctsa.operations.entropy.sample_entropy¶
-
pyhctsa.operations.entropy.sample_entropy(y, m=
2, r=None, pre_process_how=None)¶ Compute Sample Entropy (SampEn) of a time series.
This function calculates SampEn for embedding dimensions from 0 to m. The implementation uses the PhysioNet C code (sampen.c by Doug Lake) [1] for efficiency and accuracy. Can specify to first apply an incremental differencing of the time series thus yielding the ‘Control Entropy’ [2].
References
- Parameters:¶
- y : array-like¶
Input time series.
- m : int, optional¶
Maximum embedding dimension. Default is 2.
- r : float, optional¶
Similarity threshold. If None, set to 0.1 * std(y). Default is None.
- pre_process_how : str, optional¶
- Preprocessing method:
’diff1’: Use first differences
None: No pre-processing.
Default is None.
- Returns:¶
- Dictionary containing:
’sampen{m}’: Sample entropy for each m from 0 to M
’quadSampEn{m}’: Quadratic sample entropy for each m
’meanchsampen’: Mean change in sample entropy values
- Return type:¶
dict