Skip to content

Commit

Permalink
Merge branch 'fathon-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
stfbnc committed Mar 12, 2021
2 parents 99fb113 + 6ecabd2 commit 4088eed
Show file tree
Hide file tree
Showing 55 changed files with 2,066 additions and 579 deletions.
3 changes: 1 addition & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ environment:
CIBW_BEFORE_BUILD: "python -m pip install -r requirements.txt"

matrix:
- CIBW_BUILD: "cp35-win_amd64"
- CIBW_BUILD: "cp36-win_amd64"
- CIBW_BUILD: "cp37-win_amd64"
- CIBW_BUILD: "cp38-win_amd64"
- CIBW_BUILD: "cp39-win_amd64"

stack: python 3.7
stack: python 3.8

init:
- cmd: PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
Expand Down
74 changes: 20 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ matrix:
include:
##### Linux #####
##### ARM #####
### 3.5 ###
- name: "Python 3.5 on Linux arm64"
arch:
- arm64
env:
- CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
- CIBW_BUILD="cp35-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
sudo: required
python: "3.7"
services:
- docker
### 3.6 ###
- name: "Python 3.6 on Linux arm64"
arch:
Expand All @@ -36,9 +22,9 @@ matrix:
- CIBW_BUILD="cp36-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.7 ###
Expand All @@ -50,9 +36,9 @@ matrix:
- CIBW_BUILD="cp37-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.8 ###
Expand All @@ -64,9 +50,9 @@ matrix:
- CIBW_BUILD="cp38-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.9 ###
Expand All @@ -78,25 +64,12 @@ matrix:
- CIBW_BUILD="cp39-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
##### x86_64 #####
### 3.5 ###
- name: "Python 3.5 on Linux amd64"
arch:
- amd64
env:
- CIBW_BUILD="cp35-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
sudo: required
python: "3.7"
services:
- docker
### 3.6 ###
- name: "Python 3.6 on Linux amd64"
arch:
Expand All @@ -105,9 +78,9 @@ matrix:
- CIBW_BUILD="cp36-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.7 ###
Expand All @@ -118,9 +91,9 @@ matrix:
- CIBW_BUILD="cp37-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.8 ###
Expand All @@ -131,9 +104,9 @@ matrix:
- CIBW_BUILD="cp38-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
### 3.9 ###
Expand All @@ -144,46 +117,39 @@ matrix:
- CIBW_BUILD="cp39-manylinux*"
- CIBW_SKIP: "*-manylinux_i686"
language: python
dist: xenial
dist: bionic
sudo: required
python: "3.7"
python: "3.8"
services:
- docker
##### macOS #####
### 3.5 ###
- name: "Python 3.5 on macOS 10.14"
env:
- CIBW_BUILD="cp35-macosx*"
os: osx
osx_image: xcode10.2
language: shell
### 3.6 ###
- name: "Python 3.6 on macOS 10.14"
env:
- CIBW_BUILD="cp36-macosx*"
os: osx
osx_image: xcode10.2
osx_image: xcode11
language: shell
### 3.7 ###
- name: "Python 3.7 on macOS 10.14"
env:
- CIBW_BUILD="cp37-macosx*"
os: osx
osx_image: xcode10.2
osx_image: xcode11
language: shell
### 3.8 ###
- name: "Python 3.8 on macOS 10.14"
env:
- CIBW_BUILD="cp38-macosx*"
os: osx
osx_image: xcode10.2
osx_image: xcode11
language: shell
### 3.9 ###
- name: "Python 3.9 on macOS 10.14"
env:
- CIBW_BUILD="cp39-macosx*"
os: osx
osx_image: xcode10.2
osx_image: xcode11
language: shell

before_install:
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fathon [![Build Status](https://travis-ci.org/stfbnc/fathon.svg?branch=master)](https://travis-ci.org/stfbnc/fathon)[![Build status](https://ci.appveyor.com/api/projects/status/tl2a8c84bbvxu37p?svg=true)](https://ci.appveyor.com/project/stfbnc/fathon)
# fathon [![Build Status](https://travis-ci.org/stfbnc/fathon.svg?branch=master)](https://travis-ci.org/stfbnc/fathon) [![Build status](https://ci.appveyor.com/api/projects/status/tl2a8c84bbvxu37p?svg=true)](https://ci.appveyor.com/project/stfbnc/fathon)

[![Issues](https://img.shields.io/github/issues-raw/stfbnc/fathon.svg?maxAge=25000)](https://github.com/stfbnc/fathon/issues) [![GitHub stars](https://img.shields.io/github/stars/stfbnc/fathon.svg?style=social&label=Stars&style=plastic)]() [![GitHub forks](https://img.shields.io/github/forks/stfbnc/fathon.svg?style=social&label=Fork&style=plastic)]() [![Python 3.5+](https://img.shields.io/badge/python-3.5+-blue.svg)](https://www.python.org/)
[![Issues](https://img.shields.io/github/issues-raw/stfbnc/fathon.svg?maxAge=25000)](https://github.com/stfbnc/fathon/issues) [![GitHub stars](https://img.shields.io/github/stars/stfbnc/fathon.svg?style=social&label=Stars&style=plastic)]() [![GitHub forks](https://img.shields.io/github/forks/stfbnc/fathon.svg?style=social&label=Fork&style=plastic)]() [![Python 3.6+](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/)

[![DOI](https://zenodo.org/badge/214290119.svg)](https://zenodo.org/badge/latestdoi/214290119) [![DOI](https://joss.theoj.org/papers/10.21105/joss.01828/status.svg)](https://doi.org/10.21105/joss.01828)

Expand All @@ -10,28 +10,27 @@

It is mostly written in Cython and C in order to speed up computations.

`fathon` provides four main algorithms, namely
`fathon` provides five main algorithms, namely

- <code>DFA</code> (*Detrended Fluctuation Analysis*)
- <code>MFDFA</code> (*Multifractal Detrended Fluctuation Analysis*)
- <code>DCCA</code> (*Detrended Cross-Correlation Analysis*)
- <code>MFDCCA</code> (*Multifractal Detrended Cross-Correlation Analysis*)
- <code>HT</code> (*Time-dependent Hurst exponent*)

<code>MFDFA</code> also provides methods for the mass exponent τ and the multifractal spectrum *f*(α).
<code>MFDFA</code> and <code>MFDCCA</code> also provides methods for the mass exponent τ and the multifractal spectrum *f*(α).

<code>DCCA</code> has methods for computing the cross-correlation coefficient ρ_DCCA and the corresponding confidence intervals.
<code>DCCA</code> has methods to compute the cross-correlation coefficient ρ_DCCA and the corresponding confidence intervals.



### Prerequisites

| Linux i686 | Linux x86_64 | Linux ARM64 | macOS x86_64 | Windows 32bit | Windows 64bit |
| :--------: | :----------------: | :----------------: | :----------------: | :-----------: | :-----------------: |
| :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark:* |
| Linux i686 | Linux x86_64 | Linux ARM64 | macOS x86_64 | Windows 32bit | Windows 64bit |
| :--------: | :----------------: | :----------------: | :----------------: | :-----------: | :----------------: |
| :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |

<sub>*It is possible that OpenMP was not activated during compilation, so `fathon` could run slower on Windows compared to macOS and Linux</sub>

- Python 3.5 or higher
- Python 3.6 or higher
- numpy (version >= 1.15)
- Cython

Expand All @@ -41,9 +40,9 @@ As easy as `pip install fathon`

### Examples

A jupyter notebook can be used (<code>fathon_example.ipynb</code>) to play with the four algorithms provided by the `fathon` package.
A jupyter notebook can be used (<code>fathon_example.ipynb</code>) to play with the five algorithms provided by the `fathon` package.

If you cannot use the notebook, four Python scripts are provided, <code>dfa.py</code>, <code>mfdfa.py</code>, <code>dcca.py</code>, and <code>ht.py</code>.
If you cannot use the notebook, five Python scripts are provided, <code>dfa.py</code>, <code>mfdfa.py</code>, <code>dcca.py</code>, <code>mfdcca.py</code>, and <code>ht.py</code>.

Algorithms are implemented on two time series of gaussian white noise, but you can replace them with any time series you like.

Expand All @@ -63,10 +62,16 @@ Bianchi, S., (2020). fathon: A Python package for a fast computation of detrend

## Version [![PyPI version](https://badge.fury.io/py/fathon.svg)](https://badge.fury.io/py/fathon)

fathon v1.2
fathon v1.3

## Changelog

#### v1.3

- <code>MFDCCA</code> algorithm
- <code>overlap</code> option for <code>DCCA</code>, 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
Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/fun_class/fathon.DCCA.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/fun_class/fathon.DFA.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/fun_class/fathon.HT.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/doctrees/fun_class/fathon.MFDFA.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 3f3a3a407d4e9d370d01da6a59f49d6a
config: db3f5bea255d2777e941c20da7e7babc
tags: 645f666f9bcd5a90fca523b33c5a78b7
44 changes: 44 additions & 0 deletions docs/_build/html/_sources/fun_class/fathon.MFDCCA.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
MFDCCA
======

.. currentmodule:: fathon

.. autoclass:: MFDCCA
:show-inheritance:

.. automethod:: computeFlucVec
.. automethod:: computeMassExponents
.. automethod:: computeMultifractalSpectrum
.. automethod:: fitFlucVec
.. automethod:: saveObject

Usage examples
^^^^^^^^^^^^^^

.. code-block:: python
import numpy as np
import fathon
from fathon import fathonUtils as fu
#time series
a = np.random.randn(10000)
b = np.random.randn(10000)
#zero-mean cumulative sum
a = fu.toAggregated(a)
b = fu.toAggregated(b)
#initialize mfdfa object
pymfdcca = fathon.MFDCCA(a, b)
#compute fluctuation function and generalized Hurst exponents
wins = fu.linRangeByStep(10, 2000)
n, F = pymfdcca.computeFlucVec(wins, np.arange(-3, 4, 0.1), revSeg=True, polOrd=1)
list_H, list_H_intercept = pymfdcca.fitFlucVec()
#compute mass exponents
tau = pymfdcca.computeMassExponents()
#compute multifractal spectrum
alpha, mfSpect = pymfdcca.computeMultifractalSpectrum()
16 changes: 9 additions & 7 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
fathon (v1.2)
fathon (v1.3)
***************

Current version is available for Linux (x86_64 and ARM64), macOS, and Windows (64bit).

Python package for detrended fluctuation analysis (DFA) and related algorithms.
`fathon` provides four main algorithms, namely
`fathon` provides five main algorithms, namely

- `DFA` (Detrended Fluctuation Analysis)
- `MFDFA` (Multifractal Detrended Fluctuation Analysis)
- `DCCA` (Detrended Cross-Correlation Analysis)
- `DCCA` (Detrended Cross-Correlation Analysis)
- `MFDCCA` (Multifractal Detrended Cross-Correlation Analysis)
- `HT` (Time-dependent Hurst exponent)

`MFDFA` also provides methods for the mass exponent τ and the multifractal spectrum f(α).
`MFDFA` and `MFDCCA` also provides methods for the mass exponent τ and the multifractal spectrum f(α).

`DCCA` has methods for computing the cross-correlation coefficient ρ_DCCA and the corresponding confidence intervals.
`DCCA` has methods to compute the cross-correlation coefficient ρ_DCCA and the corresponding confidence intervals.

Requirements
============

- Python 3.5+
- Python 3.6+
- numpy (>=1.15)
- Cython

Expand All @@ -40,5 +41,6 @@ Documentation for the Code
fun_class/fathon.fathonUtils
fun_class/fathon.DFA
fun_class/fathon.MFDFA
fun_class/fathon.DCCA
fun_class/fathon.DCCA
fun_class/fathon.MFDCCA
fun_class/fathon.HT
7 changes: 6 additions & 1 deletion docs/_build/html/_static/pygments.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
pre { line-height: 125%; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
Expand Down
Loading

0 comments on commit 4088eed

Please sign in to comment.