Implementation in Python of the MFN method to measure complexity & entropy of time series.
Project description
mfn
Implementation in Python of the MFN method to measure complexity & entropy of time series. This is useful if you need features for a model such as Porfolio Optimization, clustering of time series, etc. This method is the implementation of the paper Scientific progress in information theory quantifiers. (Chaos, Solitons & Fractals, 170, 113260., Martins, A. M. F., Fernandes, L. H. S., & Nascimento, A. D. C. (2023).)
Installation
pip install mfn
or using Poetry
poetry add mfn
Usage
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from mfn.entropy import MFN
## Generating a time series with trend and noise.
time_series = np.arange(0, 100, 1)
time_series = time_series + np.random.normal(0, 10, size=len(time_series))
value_dict = MFN(
time_series,
b=10,
B=.1,
size=100,
dx=3
)
f, ax = plt.subplots(figsize=(6, 6))
value_df = pd.DataFrame(value_dict).reset_index()
value_df = value_df.melt(id_vars='index', value_vars=value_df.columns[1:])
sns.barplot(value_df, x='variable', y='value', errorbar="sd")
plt.title("MFN method results")
f.tight_layout()
plt.show()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mfn-0.1.0.tar.gz.
File metadata
- Download URL: mfn-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.7 Darwin/23.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b756e77add9bde3ea20f43643cde4130374fbc9aed033ac88ca1990ef06e27b
|
|
| MD5 |
ae7da7f931ea336ace18f7d796e2b64e
|
|
| BLAKE2b-256 |
550eaab23696606ee6cc015b368601812b2ab243373099d50a0b43b620b477e6
|
File details
Details for the file mfn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mfn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.7 Darwin/23.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4342be2b9b739176a6981cf982f380d21259b8c91484c68692abd4a3ab72e3
|
|
| MD5 |
567c6b1ab5324fe18a411bd01d749be4
|
|
| BLAKE2b-256 |
2e7e89d1fa490f58a744c5e04240718c8f291f164c3b26e9256f0da090f7fe72
|