Smart, automatic detection and stationarization of non-stationary time series data.
Project description
stationarizer ෴
###############
.. |PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|
Smart, automatic detection and stationarization of non-stationary time series data.
.. code-block:: python
>>> from stationarizer import simple_auto_stationarize
>>> simple_auto_stationarize(my_dataframe)
.. contents::
.. section-numbering::
Installation
============
.. code-block:: bash
pip install stationarizer
Features
========
* Plays nice with ``pandas.DataFrame`` inputs.
* Pure python.
* Supports Python 3.5+.
Use
===
Simple auto-stationarization
----------------------------
The only stationarization pipeline implemented is ``simple_auto_stationarize``, which can be called with:
.. code-block:: python
>>> 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).
Methodology
===========
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 null hypothesis (which is that the series contains a unit root) was not rejected, the series is diffentiated.
* If any series was diffrentiated, then any un-diffrentiated time series (if any) are trimmed by one step to match the resulting series length.
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.
Installing for development
----------------------------
Clone:
.. code-block:: bash
git clone git@github.com:shaypal5/stationarizer.git
Install in development mode, including test dependencies:
.. code-block:: bash
cd stationarizer
pip install -e '.[test]'
To also install ``fasttext``, see instructions in the Installation section.
Running the tests
-----------------
To run the tests use:
.. code-block:: bash
cd stationarizer
pytest
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`_.
.. _`numpy docstring conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _`these conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
Additionally, if you update this ``README.rst`` file, use ``python setup.py checkdocs`` to validate it compiles.
Credits
=======
Created by Shay Palachy (shay.palachy@gmail.com).
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/stationarizer.svg
:target: https://pypi.python.org/pypi/stationarizer
.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/stationarizer.svg
:target: https://pypi.python.org/pypi/stationarizer
.. |Build-Status| image:: https://travis-ci.org/shaypal5/stationarizer.svg?branch=master
:target: https://travis-ci.org/shaypal5/stationarizer
.. |LICENCE| image:: https://github.com/shaypal5/stationarizer/blob/master/mit_license_badge.svg
:target: https://github.com/shaypal5/stationarizer/blob/master/LICENSE
.. https://img.shields.io/github/license/shaypal5/stationarizer.svg
.. |Codecov| image:: https://codecov.io/github/shaypal5/stationarizer/coverage.svg?branch=master
:target: https://codecov.io/github/shaypal5/stationarizer?branch=master
###############
.. |PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|
Smart, automatic detection and stationarization of non-stationary time series data.
.. code-block:: python
>>> from stationarizer import simple_auto_stationarize
>>> simple_auto_stationarize(my_dataframe)
.. contents::
.. section-numbering::
Installation
============
.. code-block:: bash
pip install stationarizer
Features
========
* Plays nice with ``pandas.DataFrame`` inputs.
* Pure python.
* Supports Python 3.5+.
Use
===
Simple auto-stationarization
----------------------------
The only stationarization pipeline implemented is ``simple_auto_stationarize``, which can be called with:
.. code-block:: python
>>> 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).
Methodology
===========
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 null hypothesis (which is that the series contains a unit root) was not rejected, the series is diffentiated.
* If any series was diffrentiated, then any un-diffrentiated time series (if any) are trimmed by one step to match the resulting series length.
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.
Installing for development
----------------------------
Clone:
.. code-block:: bash
git clone git@github.com:shaypal5/stationarizer.git
Install in development mode, including test dependencies:
.. code-block:: bash
cd stationarizer
pip install -e '.[test]'
To also install ``fasttext``, see instructions in the Installation section.
Running the tests
-----------------
To run the tests use:
.. code-block:: bash
cd stationarizer
pytest
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`_.
.. _`numpy docstring conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _`these conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
Additionally, if you update this ``README.rst`` file, use ``python setup.py checkdocs`` to validate it compiles.
Credits
=======
Created by Shay Palachy (shay.palachy@gmail.com).
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/stationarizer.svg
:target: https://pypi.python.org/pypi/stationarizer
.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/stationarizer.svg
:target: https://pypi.python.org/pypi/stationarizer
.. |Build-Status| image:: https://travis-ci.org/shaypal5/stationarizer.svg?branch=master
:target: https://travis-ci.org/shaypal5/stationarizer
.. |LICENCE| image:: https://github.com/shaypal5/stationarizer/blob/master/mit_license_badge.svg
:target: https://github.com/shaypal5/stationarizer/blob/master/LICENSE
.. https://img.shields.io/github/license/shaypal5/stationarizer.svg
.. |Codecov| image:: https://codecov.io/github/shaypal5/stationarizer/coverage.svg?branch=master
:target: https://codecov.io/github/shaypal5/stationarizer?branch=master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stationarizer-0.0.1.tar.gz
(24.3 kB
view details)
Built Distribution
File details
Details for the file stationarizer-0.0.1.tar.gz
.
File metadata
- Download URL: stationarizer-0.0.1.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a22efe2f7b3abfc7c84474ed7f50b2c4fd8c1c61bdd144a5de63a646a52d8b3 |
|
MD5 | d1756d010648f63f2141efac8c05fcd4 |
|
BLAKE2b-256 | 3d637979eafd0940aacb88c103626b83f34675dbf58b199f775335b4f7122218 |
File details
Details for the file stationarizer-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: stationarizer-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70632fc2bfc9bc8e26b04eb1a7ad27f82de80c6590e8566e2c2ea4eb6a695890 |
|
MD5 | 8db7603f224eea3e3123e651f8f19e1b |
|
BLAKE2b-256 | 7069af7b0ef152b2dd36e4981dd97a07c8d0ff827df284cda7cb3e01715cb733 |