fathon
fathon copied to clipboard
python package for DFA (Detrended Fluctuation Analysis) and related algorithms
fathon

fathon
is a python package for DFA (Detrended Fluctuation Analysis) and related algorithms.
It is mostly written in Cython and C in order to speed up computations.
fathon
provides five main algorithms, namely
-
DFA
(Detrended Fluctuation Analysis) -
MFDFA
(Multifractal Detrended Fluctuation Analysis) -
DCCA
(Detrended Cross-Correlation Analysis) -
MFDCCA
(Multifractal Detrended Cross-Correlation Analysis) -
HT
(Time-dependent Hurst exponent)
MFDFA
and MFDCCA
also provides methods for the mass exponent τ and the multifractal spectrum f(α).
DCCA
has methods to compute the cross-correlation coefficient ρ_DCCA and the corresponding confidence intervals.
Supported platforms
Linux x86_64 | Linux ARM64 | macOS x86_64 | macOS ARM64 | Windows 64bit |
---|---|---|---|---|
:white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
Prerequisites
- Python 3.7 or higher
- numpy (version >= 1.20)
Installing
As easy as pip install fathon
Examples
A jupyter notebook can be used (fathon_example.ipynb
) to play with the five algorithms provided by the fathon
package.
If you cannot use the notebook, five Python scripts are provided, dfa.py
, mfdfa.py
, dcca.py
, mfdcca.py
, and ht.py
.
Algorithms are implemented on two time series of gaussian white noise, but you can replace them with any time series you like.
Documentation 
Contributing
To report bugs or improvements, or for any other question, please see CONTRIBUTING.md.
Credits
If you are using fathon
in your research, please cite:
Bianchi, S., (2020). fathon: A Python package for a fast computation of detrendend fluctuation analysis and related algorithms. Journal of Open Source Software, 5(45), 1828, https://doi.org/10.21105/joss.01828
Changelog
v1.3.1
- faster algorithms
v1.3
-
MFDCCA
algorithm -
overlap
option forDCCA
, to allow using both overlapping and non-overlapping windows - OpenMP also for Windows
v1.2
- few adjustments to C extensions for Windows' C compiler compatibility
v1.1
- save object state to binary file and reload it later
v1.0
- wheels! :ferris_wheel::ferris_wheel:
- no more pre-installing step of the GSL library :tada::tada:
- window's sizes array must be now passed to all the methods
-
logBase
option for methods that perform fits -
verbose
option - pre-computed
hq0
can be now passed to thecomputeHT
method
v0.1.2
- first release
Author
- Stefano Bianchi
- github - stfbnc
License 
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
This code uses GSL which is licensed under the GNU General Public License v3.0, and can be obtained at https://www.gnu.org/software/gsl/.