Skip to main content
https://github.com/CSchoel/nolds/actions/workflows/ci.yaml/badge.svg https://zenodo.org/badge/DOI/10.5281/zenodo.3814723.svg https://api.codacy.com/project/badge/Grade/42c30d253b384e87a86b70c8fa0da6b2 https://codecov.io/gh/CSchoel/nolds/graph/badge.svg?token=Xgr82QKhFi

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 (sampen)

Measures the complexity of a time-series, based on approximate entropy

correlation dimension (corr_dim)

A measure of the fractal dimension of a time series which is also related to complexity.

Lyapunov exponent (lyap_r, lyap_e)

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 (hurst_rs)

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)

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).

Generalized Hurst Exponent (mfhurst_b)

The Generalized Hurst Exponent (GHE, H_q or H(q)) can (as the name implies) be seen as a generalization of the Hurst exponent for data series with multifractal properties. It’s origins are however not directly related to Hurst’s rescaled range approach, but to the definition of self-affine functions.

Example

import nolds
import numpy as np

rwalk = np.cumsum(np.random.random(1000))
h = nolds.dfa(rwalk)

Requirements

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:

  • If you want to use the RANSAC algorithm for line fitting, you will also need the package sklearn.

  • For the true random numbers generated by nolds.qrandom you need the package quantumrandom.

  • The plotting functions in nolds.examples require the package matplotlib.

Installation

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

Documentation

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 and on Read the Docs.

The relevant measures can be found in the file nolds/measures.py.

How to cite nolds

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 Zenodo reference:

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.

Contact information

If you have any questions, suggestions or corrections, you can find my contact information in my GitHub profile or on my blog.

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.

Metadata

Release files for nolds 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for nolds 0.6.0
File Interpreter ABI Platform
nolds-0.6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / nolds-0.6.0-py2.py3-none-any.whl

Download URL nolds-0.6.0-py2.py3-none-any.whl
Size 223.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e7f1e30e3ece7db1fcb774d27effa4551736f314623087a808e21cef62ece5a6
BLAKE2b-256 checksum
How to use checksums
2ceaf5454d5abd658d2b33d28139000c9ce80b0f2e56214b29bed027afc027da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

This release

0.6.0 This release

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

2 release files

0.2.0

1 release file

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page