Metadata-Version: 2.1
Name: tsfracdiff
Version: 1.0.4
Summary: Efficient and easy to use fractional differentiation transformations for stationarizing time series data.
Home-page: https://github.com/adamvvu/tsfracdiff
Author: Adam Wu
Author-email: adamwu1@outlook.com
License: MIT License
        
        Copyright (c) [2022] [adamvvu]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://github.com/adamvvu/tsfracdiff
Project-URL: documentation, https://github.com/adamvvu/tsfracdiff
Project-URL: repository, https://github.com/adamvvu/tsfracdiff
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Programming Language :: Python :: 3 
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

[![Build](https://img.shields.io/github/actions/workflow/status/adamvvu/tsfracdiff/tsfracdiff_tests.yml?style=for-the-badge)](https://github.com/adamvvu/tsfracdiff/actions/workflows/tsfracdiff_tests.yml)
[![PyPi](https://img.shields.io/pypi/v/tsfracdiff?style=for-the-badge)](https://pypi.org/project/tsfracdiff/)
[![Downloads](https://img.shields.io/pypi/dm/tsfracdiff?style=for-the-badge)](https://pypi.org/project/tsfracdiff/)
[![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](https://github.com/adamvvu/tsfracdiff/blob/master/LICENSE)

Efficient and easy to use fractional differentiation transformations for
stationarizing time series data in Python.

------------------------------------------------------------------------

## **tsfracdiff**

Data with high persistence, serial correlation, and non-stationarity
pose significant challenges when used directly as predictive signals in
many machine learning and statistical models. A common approach is to
take the first difference as a stationarity transformation, but this
wipes out much of the information available in the data. For datasets
where there is a low signal-to-noise ratio such as financial market
data, this effect can be particularly severe. Hosking (1981) introduces
fractional (non-integer) differentiation for its flexibility in modeling
short-term and long-term time series dynamics, and López de Prado (2018)
proposes the use of fractional differentiation as a feature
transformation for financial machine learning applications. This library
is an extension of their ideas, with some modifications for efficiency
and robustness.

[Documentation](https://adamvvu.github.io/tsfracdiff/docs/)

## Getting Started

### Installation

`pip install tsfracdiff`

#### Dependencies:

    # Required
    python3 # Python 3.7+
    numpy
    pandas
    arch

    # Suggested
    joblib

### Usage

``` python
# A pandas.DataFrame/np.array with potentially non-stationary time series
df 

# Automatic stationary transformation with minimal information loss
from tsfracdiff import FractionalDifferentiator
fracDiff = FractionalDifferentiator()
df = fracDiff.FitTransform(df)
```

For a more in-depth example, see this
[notebook](https://adamvvu.github.io/tsfracdiff/examples/Example.html).

## References

Hosking, J. R. M. (1981). Fractional Differencing. Biometrika, 68(1),
165--176. <https://doi.org/10.2307/2335817>

López de Prado, Marcos (2018). Advances in Financial Machine Learning.
John Wiley & Sons, Inc.
