Skip to main content

1 stationarizer ෴

PyPI-Status PyPI-Versions Build-Status Codecov Codacy Badge Requirements Status LICENCE

Smart, automatic detection and stationarization of non-stationary time series data.

>>> from stationarizer import simple_auto_stationarize
>>> simple_auto_stationarize(my_dataframe)

1.1 Installation

pip install stationarizer

1.2 Features

  • Plays nice with pandas.DataFrame inputs.

  • Pure python.

  • Supports Python 3.6+.

1.3 Use

1.3.1 Simple auto-stationarization

The only stationarization pipeline implemented is simple_auto_stationarize, which can be called with:

>>> from stationarizer import simple_auto_stationarize
>>> stationarized_df = simple_auto_stationarize(my_dataframe)

The level to which false discovery rate (FDR) is controled can be configured with the alpha parameter, while the method for multitest error control can be configured with multitest (changing this can change alpha to control for FWER instead).

1.4 Methodology

1.4.1 Simple auto-stationarization

Currently only the following simple flow - dealing with unit roots - is implemented:

  • Data validation is performed: all columns are checked to be numeric, and the time dimension is assumed to be larger than the number of series (although this is not mandatory, and so only a warning is thrown in case of violation).

  • Both the Augmented Dickey-Fuller unit root test and the KPSS test are performed for each of the series.

  • The p-values of all tests are corrected to control the false discovery rate (FDR) at some given level, using the Benjamini–Yekutieli procedure.

  • The joint ADF-KPSS results are interpreted for each test.

  • For each time series for which the presence of a unit root cannot be rejected, the series is diffentiated.

  • For each time series for which the presence of a trend cannot be rejected, the series is de-trended.

  • If any series was diffrentiated, then any un-diffrentiated time series (if any) are trimmed by one step to match the resulting series length.

1.5 Contributing

Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.

1.5.1 Installing for development

Clone:

git clone git@github.com:shaypal5/stationarizer.git

Install in development mode, including test dependencies:

cd stationarizer
pip install -e '.[test]'

To also install fasttext, see instructions in the Installation section.

1.5.2 Running the tests

To run the tests use:

cd stationarizer
pytest

1.5.3 Adding documentation

The project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings. When documenting code you add to this project, follow these conventions.

Additionally, if you update this README.rst file, use python setup.py checkdocs to validate it compiles.

1.6 Credits

Created by Shay Palachy (shay.palachy@gmail.com).

Metadata

Release files for stationarizer 0.0.11

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

Source distribution (sdist)

Source distribution for stationarizer 0.0.11
File Size Uploaded
stationarizer-0.0.11.tar.gz 25.5 kB Details

Built distribution (wheel)

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

Total release size: 37.0 kB

Release files / stationarizer-0.0.11.tar.gz

Download URL stationarizer-0.0.11.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e3f3e1a64e7ec7eae93175f0cacb8f9ec8e415fa02dbfbad9dda3f5e2667d40f
BLAKE2b-256 checksum
How to use checksums
3f8d12b5b691d7a89dd1a24417d170d9d1e176264440464778032119b1ca7b2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release files / stationarizer-0.0.11-py3-none-any.whl

Download URL stationarizer-0.0.11-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cc62fc9f9294601c15d6d5bbb972a0fbbde03c79995ca60ede6ceafc379e2b3
BLAKE2b-256 checksum
How to use checksums
ac308aa98cdd58ab7f1e62dd0b56d326f5071a853b1fd72b00c9c7ae4d2a164a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

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