Skip to main content

Python package 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.

Contents

Overview

Many natural and artificial systems have the capacity to undergo a sudden change in their dynamics. From the perspective of dynamical systems, these changes often 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 lag-1 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, and maintain the toolbox to include the latest proposed indicators for testing and application. This toolbox complements an excellent early warning signals toolbox written in R (Dakos et al. 2012). We hope that having a toolbox written in Python will allow for additional testing, and appeal to those who primarily write code in Python.

Functionality of ewstools includes

  • Time series detrending using either

    • A Gaussian kernel
    • LOWESS (Locally Weighted Scatterplot Smoothing)
  • Computation of the following statistical metrics over a rolling window:

    • Variance and associated metrics (standard deviation, coefficient of variation)
    • Autocorrelation (at specified lag times)
    • Higher-order statistical moments (skewness, kurtosis)
    • Power spectrum and associated metrics (maximum frequency, coherence factor, 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
  • 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 package dependencies listed in requiements_dev.txt. The Python package should be compatible with Windows, Mac, and Linux operating systems. The demos require Jupyter notebook.

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 would like to be a contributor, please fork the repository and make a pull request! If you run into issues with the software, you can post them 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-1.0.1.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

ewstools-1.0.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ewstools-1.0.1.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for ewstools-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1e92cf9c0289c82dfc189a9e84724a33328f0cc15529f09c6fc28682bb5662b8
MD5 50f8ce62297191d74cb7ad7397100ab2
BLAKE2b-256 2fbcae5aa766b30739acc1ad64c30870eedbbbccd27bafba86c0db4ccec9c8e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ewstools-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for ewstools-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f59993b5d63135aabfa854d0c57725a985d9b59b83a392453d2ff60376ef6e6e
MD5 6d1f8aba7f742d1d409632fffbbcb19f
BLAKE2b-256 2c9521b6caae8458ac0e02d6b3eb56127136cb75fe5562ae642d829472070bac

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