Skip to main content

A package with tools to compute early warning signals (EWS) from time-series data

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ewstools-0.0.8.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

ewstools-0.0.8-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file ewstools-0.0.8.tar.gz.

File metadata

  • Download URL: ewstools-0.0.8.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for ewstools-0.0.8.tar.gz
Algorithm Hash digest
SHA256 d088c62bca3c1023b64c5b78d1f39c55bc82af7df4a06478af2df7b27d1e6dcf
MD5 d0d2490d245f0c8072fea2d5ac62764b
BLAKE2b-256 6f8a81797b8cdc6f766500b4aad261af138926d7c645ef4da23db4a491e52495

See more details on using hashes here.

File details

Details for the file ewstools-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: ewstools-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for ewstools-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ae62d6525ac16889ba18ca383f1059f8c614d4f8e4083a04b620f6e1587db301
MD5 f010fa24c6a20e1c6becbd05b7134008
BLAKE2b-256 dd32ad740d5c70eaf037f798729797c68c90665f9f57ca09e46574f62d6316e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page