complexeva¶
Fast, low-memory complexity measures for 1D time series (EEG, MEG, physiology).
pip install complexeva # Python 3.14+
import numpy
import complexeva
signal = numpy.random.randn(1000) # one signal, shape (time,)
complexeva.hfd(signal) # one float
batches¶
Pass every signal at once with time on the last axis; you get one value per signal, in the shape of the other axes. Each value is identical to calling the measure on that signal alone.
eeg = numpy.random.randn(64, 1000) # (channels, time)
complexeva.hfd(eeg) # shape (64,)
study = numpy.random.randn(20, 64, 1000) # (subjects, channels, time)
complexeva.sample_entropy(study) # shape (20, 64)
recording = numpy.random.randn(1000, 64) # time first? put time last
complexeva.dfa(recording.T) # shape (64,)
windows = numpy.lib.stride_tricks.sliding_window_view(signal, 200)[::10] # (windows, 200), no copy
complexeva.permutation_entropy(windows) # one value per window
Batches work for every measure except lyapunov_exponent, compression_complexity, the _hilbert variants and binary-string lempel_ziv, which take one signal. multiscale_entropy adds a last axis of scales, and hjorth returns a (mobility, complexity) pair of arrays. A non-finite sample raises an error naming its full index; a constant signal gives NaN in its place. NUMBA_NUM_THREADS limits the threads.
measures¶
measure |
input |
paper |
|
|---|---|---|---|
sample entropy |
|||
approximate entropy |
|||
correlation dimension |
|||
detrended fluctuation analysis |
|||
permutation entropy |
|||
largest Lyapunov exponent |
|||
multiscale entropy |
Costa 2002 |
||
Higuchi fractal dimension |
|||
Hjorth mobility and complexity |
|||
compression complexity |
|||
fuzzy entropy |
|||
Katz fractal dimension |
|||
Lempel–Ziv complexity |
|||
spectral entropy |
|||
Petrosian fractal dimension |
|||
SVD entropy |
speed and memory vs other packages¶

Batches, against a loop of the best other package (NUMBA_NUM_THREADS sets the thread count):

validation¶


licence¶
MIT















