Skip to content

Commit 4088eed

Browse files
committed
Merge branch 'fathon-dev'
2 parents 99fb113 + 6ecabd2 commit 4088eed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2066
-579
lines changed

.appveyor.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ environment:
1313
CIBW_BEFORE_BUILD: "python -m pip install -r requirements.txt"
1414

1515
matrix:
16-
- CIBW_BUILD: "cp35-win_amd64"
1716
- CIBW_BUILD: "cp36-win_amd64"
1817
- CIBW_BUILD: "cp37-win_amd64"
1918
- CIBW_BUILD: "cp38-win_amd64"
2019
- CIBW_BUILD: "cp39-win_amd64"
2120

22-
stack: python 3.7
21+
stack: python 3.8
2322

2423
init:
2524
- cmd: PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

.travis.yml

+20-54
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ matrix:
1313
include:
1414
##### Linux #####
1515
##### ARM #####
16-
### 3.5 ###
17-
- name: "Python 3.5 on Linux arm64"
18-
arch:
19-
- arm64
20-
env:
21-
- CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
22-
- CIBW_BUILD="cp35-manylinux*"
23-
- CIBW_SKIP: "*-manylinux_i686"
24-
language: python
25-
dist: xenial
26-
sudo: required
27-
python: "3.7"
28-
services:
29-
- docker
3016
### 3.6 ###
3117
- name: "Python 3.6 on Linux arm64"
3218
arch:
@@ -36,9 +22,9 @@ matrix:
3622
- CIBW_BUILD="cp36-manylinux*"
3723
- CIBW_SKIP: "*-manylinux_i686"
3824
language: python
39-
dist: xenial
25+
dist: bionic
4026
sudo: required
41-
python: "3.7"
27+
python: "3.8"
4228
services:
4329
- docker
4430
### 3.7 ###
@@ -50,9 +36,9 @@ matrix:
5036
- CIBW_BUILD="cp37-manylinux*"
5137
- CIBW_SKIP: "*-manylinux_i686"
5238
language: python
53-
dist: xenial
39+
dist: bionic
5440
sudo: required
55-
python: "3.7"
41+
python: "3.8"
5642
services:
5743
- docker
5844
### 3.8 ###
@@ -64,9 +50,9 @@ matrix:
6450
- CIBW_BUILD="cp38-manylinux*"
6551
- CIBW_SKIP: "*-manylinux_i686"
6652
language: python
67-
dist: xenial
53+
dist: bionic
6854
sudo: required
69-
python: "3.7"
55+
python: "3.8"
7056
services:
7157
- docker
7258
### 3.9 ###
@@ -78,25 +64,12 @@ matrix:
7864
- CIBW_BUILD="cp39-manylinux*"
7965
- CIBW_SKIP: "*-manylinux_i686"
8066
language: python
81-
dist: xenial
67+
dist: bionic
8268
sudo: required
83-
python: "3.7"
69+
python: "3.8"
8470
services:
8571
- docker
8672
##### x86_64 #####
87-
### 3.5 ###
88-
- name: "Python 3.5 on Linux amd64"
89-
arch:
90-
- amd64
91-
env:
92-
- CIBW_BUILD="cp35-manylinux*"
93-
- CIBW_SKIP: "*-manylinux_i686"
94-
language: python
95-
dist: xenial
96-
sudo: required
97-
python: "3.7"
98-
services:
99-
- docker
10073
### 3.6 ###
10174
- name: "Python 3.6 on Linux amd64"
10275
arch:
@@ -105,9 +78,9 @@ matrix:
10578
- CIBW_BUILD="cp36-manylinux*"
10679
- CIBW_SKIP: "*-manylinux_i686"
10780
language: python
108-
dist: xenial
81+
dist: bionic
10982
sudo: required
110-
python: "3.7"
83+
python: "3.8"
11184
services:
11285
- docker
11386
### 3.7 ###
@@ -118,9 +91,9 @@ matrix:
11891
- CIBW_BUILD="cp37-manylinux*"
11992
- CIBW_SKIP: "*-manylinux_i686"
12093
language: python
121-
dist: xenial
94+
dist: bionic
12295
sudo: required
123-
python: "3.7"
96+
python: "3.8"
12497
services:
12598
- docker
12699
### 3.8 ###
@@ -131,9 +104,9 @@ matrix:
131104
- CIBW_BUILD="cp38-manylinux*"
132105
- CIBW_SKIP: "*-manylinux_i686"
133106
language: python
134-
dist: xenial
107+
dist: bionic
135108
sudo: required
136-
python: "3.7"
109+
python: "3.8"
137110
services:
138111
- docker
139112
### 3.9 ###
@@ -144,46 +117,39 @@ matrix:
144117
- CIBW_BUILD="cp39-manylinux*"
145118
- CIBW_SKIP: "*-manylinux_i686"
146119
language: python
147-
dist: xenial
120+
dist: bionic
148121
sudo: required
149-
python: "3.7"
122+
python: "3.8"
150123
services:
151124
- docker
152125
##### macOS #####
153-
### 3.5 ###
154-
- name: "Python 3.5 on macOS 10.14"
155-
env:
156-
- CIBW_BUILD="cp35-macosx*"
157-
os: osx
158-
osx_image: xcode10.2
159-
language: shell
160126
### 3.6 ###
161127
- name: "Python 3.6 on macOS 10.14"
162128
env:
163129
- CIBW_BUILD="cp36-macosx*"
164130
os: osx
165-
osx_image: xcode10.2
131+
osx_image: xcode11
166132
language: shell
167133
### 3.7 ###
168134
- name: "Python 3.7 on macOS 10.14"
169135
env:
170136
- CIBW_BUILD="cp37-macosx*"
171137
os: osx
172-
osx_image: xcode10.2
138+
osx_image: xcode11
173139
language: shell
174140
### 3.8 ###
175141
- name: "Python 3.8 on macOS 10.14"
176142
env:
177143
- CIBW_BUILD="cp38-macosx*"
178144
os: osx
179-
osx_image: xcode10.2
145+
osx_image: xcode11
180146
language: shell
181147
### 3.9 ###
182148
- name: "Python 3.9 on macOS 10.14"
183149
env:
184150
- CIBW_BUILD="cp39-macosx*"
185151
os: osx
186-
osx_image: xcode10.2
152+
osx_image: xcode11
187153
language: shell
188154

189155
before_install:

README.md

+19-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 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)
1+
# 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)
22

3-
[![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/)
3+
[![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/)
44

55
[![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)
66

@@ -10,28 +10,27 @@
1010

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

13-
`fathon` provides four main algorithms, namely
13+
`fathon` provides five main algorithms, namely
1414

1515
- <code>DFA</code> (*Detrended Fluctuation Analysis*)
1616
- <code>MFDFA</code> (*Multifractal Detrended Fluctuation Analysis*)
1717
- <code>DCCA</code> (*Detrended Cross-Correlation Analysis*)
18+
- <code>MFDCCA</code> (*Multifractal Detrended Cross-Correlation Analysis*)
1819
- <code>HT</code> (*Time-dependent Hurst exponent*)
1920

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

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

2425

2526

2627
### Prerequisites
2728

28-
| Linux i686 | Linux x86_64 | Linux ARM64 | macOS x86_64 | Windows 32bit | Windows 64bit |
29-
| :--------: | :----------------: | :----------------: | :----------------: | :-----------: | :-----------------: |
30-
| :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark:* |
29+
| Linux i686 | Linux x86_64 | Linux ARM64 | macOS x86_64 | Windows 32bit | Windows 64bit |
30+
| :--------: | :----------------: | :----------------: | :----------------: | :-----------: | :----------------: |
31+
| :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
3132

32-
<sub>*It is possible that OpenMP was not activated during compilation, so `fathon` could run slower on Windows compared to macOS and Linux</sub>
33-
34-
- Python 3.5 or higher
33+
- Python 3.6 or higher
3534
- numpy (version >= 1.15)
3635
- Cython
3736

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

4241
### Examples
4342

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

46-
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>.
45+
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>.
4746

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

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

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

66-
fathon v1.2
65+
fathon v1.3
6766

6867
## Changelog
6968

69+
#### v1.3
70+
71+
- <code>MFDCCA</code> algorithm
72+
- <code>overlap</code> option for <code>DCCA</code>, to allow using both overlapping and non-overlapping windows
73+
- OpenMP also for Windows
74+
7075
#### v1.2
7176

7277
- few adjustments to C extensions for Windows' C compiler compatibility
1.93 KB
Binary file not shown.
Binary file not shown.
-11 Bytes
Binary file not shown.
2 Bytes
Binary file not shown.
Binary file not shown.
-32 Bytes
Binary file not shown.

docs/_build/doctrees/index.doctree

599 Bytes
Binary file not shown.

docs/_build/html/.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 3f3a3a407d4e9d370d01da6a59f49d6a
3+
config: db3f5bea255d2777e941c20da7e7babc
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
MFDCCA
2+
======
3+
4+
.. currentmodule:: fathon
5+
6+
.. autoclass:: MFDCCA
7+
:show-inheritance:
8+
9+
.. automethod:: computeFlucVec
10+
.. automethod:: computeMassExponents
11+
.. automethod:: computeMultifractalSpectrum
12+
.. automethod:: fitFlucVec
13+
.. automethod:: saveObject
14+
15+
Usage examples
16+
^^^^^^^^^^^^^^
17+
18+
.. code-block:: python
19+
20+
import numpy as np
21+
import fathon
22+
from fathon import fathonUtils as fu
23+
24+
#time series
25+
a = np.random.randn(10000)
26+
b = np.random.randn(10000)
27+
28+
#zero-mean cumulative sum
29+
a = fu.toAggregated(a)
30+
b = fu.toAggregated(b)
31+
32+
#initialize mfdfa object
33+
pymfdcca = fathon.MFDCCA(a, b)
34+
#compute fluctuation function and generalized Hurst exponents
35+
wins = fu.linRangeByStep(10, 2000)
36+
n, F = pymfdcca.computeFlucVec(wins, np.arange(-3, 4, 0.1), revSeg=True, polOrd=1)
37+
list_H, list_H_intercept = pymfdcca.fitFlucVec()
38+
39+
#compute mass exponents
40+
tau = pymfdcca.computeMassExponents()
41+
42+
#compute multifractal spectrum
43+
alpha, mfSpect = pymfdcca.computeMultifractalSpectrum()
44+

docs/_build/html/_sources/index.rst.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
fathon (v1.2)
6+
fathon (v1.3)
77
***************
88

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

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

1414
- `DFA` (Detrended Fluctuation Analysis)
1515
- `MFDFA` (Multifractal Detrended Fluctuation Analysis)
16-
- `DCCA` (Detrended Cross-Correlation Analysis)
16+
- `DCCA` (Detrended Cross-Correlation Analysis)
17+
- `MFDCCA` (Multifractal Detrended Cross-Correlation Analysis)
1718
- `HT` (Time-dependent Hurst exponent)
1819

19-
`MFDFA` also provides methods for the mass exponent τ and the multifractal spectrum f(α).
20+
`MFDFA` and `MFDCCA` also provides methods for the mass exponent τ and the multifractal spectrum f(α).
2021

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

2324
Requirements
2425
============
2526

26-
- Python 3.5+
27+
- Python 3.6+
2728
- numpy (>=1.15)
2829
- Cython
2930

@@ -40,5 +41,6 @@ Documentation for the Code
4041
fun_class/fathon.fathonUtils
4142
fun_class/fathon.DFA
4243
fun_class/fathon.MFDFA
43-
fun_class/fathon.DCCA
44+
fun_class/fathon.DCCA
45+
fun_class/fathon.MFDCCA
4446
fun_class/fathon.HT

docs/_build/html/_static/pygments.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
pre { line-height: 125%; }
2+
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
3+
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
4+
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
5+
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
16
.highlight .hll { background-color: #ffffcc }
2-
.highlight { background: #eeffcc; }
7+
.highlight { background: #eeffcc; }
38
.highlight .c { color: #408090; font-style: italic } /* Comment */
49
.highlight .err { border: 1px solid #FF0000 } /* Error */
510
.highlight .k { color: #007020; font-weight: bold } /* Keyword */

0 commit comments

Comments
 (0)