Nolds is a small numpy-based library that provides an implementation and a learning resource for nonlinear measures for dynamical systems based on one-dimensional time series. Currently the following measures are implemented:
sample entropy (
Measures the complexity of a time-series, based on approximate entropy
correlation dimension (
A measure of the fractal dimension of a time series which is also related to complexity.
Lyapunov exponent (
Positive Lyapunov exponents indicate chaos and unpredictability.
Nolds provides the algorithm of Rosenstein et al. (
lyap_r) to estimate the largest Lyapunov exponent and the algorithm of Eckmann et al. (
lyap_e) to estimate the whole spectrum of Lyapunov exponents.
Hurst exponent (
The hurst exponent is a measure of the "long-term memory" of a time series.
It can be used to determine whether the time series is more, less, or equally likely to increase if it has increased in previous steps.
This property makes the Hurst exponent especially interesting for the analysis of stock data.
detrended fluctuation analysis (DFA) (
DFA measures the Hurst parameter H, which is very similar to the Hurst exponent.
The main difference is that DFA can be used for non-stationary processes (whose mean and/or variance change over time).
import nolds import numpy as np rwalk = np.cumsum(np.random.random(1000)) h = nolds.dfa(rwalk)
Nolds supports Python 2 (>= 2.7) and 3 (>= 3.4) from one code source. It requires the package numpy_.
These are the only hard requirements, but some functions will need other packages:
nolds.qrandomyou need the package quantumrandom_.
nolds.examplesrequire the package matplotlib_.
Nolds is available through PyPI and can be installed using pip:
pip install nolds
You can test your installation by running some sample code with:
python -m nolds.examples lyapunov-logistic
Alternatively, if you do not have matplotlib_ installed, you can run the unittests with:
python -m unittest nolds.test_measures
Nolds is designed as a learning resource for the measures mentioned above.
Therefore the corresponding functions feature extensive documentation that not only explains the interface but also the algorithm used and points the user to additional reference code and papers.
The documentation can be found in the code, but it is also available as
HTML-Version <https://cschoel.github.io/nolds/> and on
Read the Docs <http://nolds.readthedocs.io/>.
The relevant measures can be found in the file
I am planning to publish nolds in a peer-reviewed journal, but as this is a side project of my PhD thesis this may take a while.
For the time being you can use the following
Schölzel, Christopher. (2019, June 16). Nonlinear measures for dynamical systems (Version 0.5.2). Zenodo. http://doi.org/10.5281/zenodo.3814723
You can also
export a BibTeX reference_ from Zenodo.
If you have any questions, suggestions or corrections, you can find my contact
my GitHub profile or on
Please note that this is one of my side projects. Depending on my current workload it may take days, weeks or even months until I can find the time to check on mails and issues for nolds.