Skip to main content

PyPI version Build Status Coverage Status DOI

ewstools

Python package for computing, analysing and visualising early warning signals (EWS) in time series data. Includes a novel approach to characterise bifurcations using Spectral EWS.

Contents

Overview

Many natural and artificial systems have the capacity to undergo a sudden change in their dynamics. In the mathematical realm of dynamical systems, these changes corresopond to bifurcations, and theory therein suggests that certain signals, observable in time series data, should precede these bifurcations (Scheffer et al. 2009). Two commonly used metrics include variance and autocorrelation, though there exist many others (see e.g. Clements & Ozgul 2018). Our objective with this package is to provide a user-friendly toolbox in Python to compute early warning signals from time series data. This complements another early warning signal toolbox written in R (Dakos et al. 2012), and provides novel tools to extract information on the bifurcation from the power spectrum - results to be published soon.

Functionality of ewstools includes

  • Detrending using either

    • Gaussian smoothing
    • A Lowess filter
  • Computation of the following statistical properties over a rolling window:

    • Variance and its derivatives (standard deviation, coefficient of variation)
    • Autocorrelation (at specified lag times)
    • Higher-order moments (skewness, kurtosis)
    • Power spectrum (including maximum frequency, coherence factor and AIC weights csp. to canonical power spectrum forms)
  • Block-bootstrapping time-series to obtain confidence bounds on EWS estimates

  • Visualisation of EWS with plots of time-series and power spectra.

Repo Contents

  • demos: interactive demos in Jupyter notebooks to illustrate use of package
  • docs: version-controlled package documentation provided in ReadTheDocs
  • ewstools: package code
  • nat_comms: supporting code for paper submission to Nature Communications
  • tests: testing of package functions using pytest

System Requirements

Hardware Requirements

ewstools can run on a standard computer with enough RAM to support the operations defined by a user. The software has been tested on a computer with the following specs

RAM: 8G, CPU: 2.7 GHz

though the software should run as expected on computers with lower RAM. The runtimes outlined below were generated on the computer with these specs.

Software Requirements

ewstools requires Python 3.7 or higher and has the following package dependencies:

pandas==0.24.2
numpy==1.16.2
arch==4.7
lmfit==0.9.12

The Python package should be compatible with Windows, Mac, and Linux operating systems. The demonstrations require Jupyter notebook, which can be installed

Installation Guide

Friendly instructions for downloading Python 3 on Linux, Mac OS and Windows are available here.

Then, the package ewstools may be installed using pip, by entering the following into Terminal (Mac/Linux) or Command Prompt (Windows)

pip install ewstools

which includes all package dependencies. Installation of the package should take less than one minute on a standard computer. To interact with the demos, Jupyter notebook is required, which can be installed using

pip install jupyterlab

and takes no longer than a minute to download.

Demos

For interacitve demonstrations on using ewstools, please refer to these iPython notebooks.

Documentation

Full documentation is available on ReadTheDocs.

Contribution

If you are interested in being a contributer, or run into trouble with the package, please post on the issue tracker.

Release files for ewstools 0.0.6

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

Source distribution (sdist)

Source distribution for ewstools 0.0.6
File Size Uploaded
ewstools-0.0.6.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ewstools 0.0.6
File Interpreter ABI Platform
ewstools-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 40.1 kB

Release files / ewstools-0.0.6.tar.gz

Download URL ewstools-0.0.6.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7ce5bbf68e04f6b142e9abd5e74eaaa3b9272b4ece6326eec2a7bc8efdaca769
BLAKE2b-256 checksum
How to use checksums
10f7bbdcfd7a0e561ac316ff6f331ea7411b0b5fa46e6e61c903e95a955b7791
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.3

Release files / ewstools-0.0.6-py3-none-any.whl

Download URL ewstools-0.0.6-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9e596b41d5c95f2c97a2760c05aca86aa127774b28efcb31169b7f5c34a1688
BLAKE2b-256 checksum
How to use checksums
781127034045502b63b89032c8d5e258f8fa3081f94460982c70f931d7244a03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.3

Release history Release notifications | RSS feed

2.1.3

2 release files

2.1.2

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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