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()
Metadata
Release files for mfn 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mfn-0.1.0.tar.gz | 4.5 kB | Without provenance | Details for mfn-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mfn-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mfn-0.1.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / mfn-0.1.0.tar.gz
| Download URL | mfn-0.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b756e77add9bde3ea20f43643cde4130374fbc9aed033ac88ca1990ef06e27b
|
|
BLAKE2b-256 checksum How to use checksums |
550eaab23696606ee6cc015b368601812b2ab243373099d50a0b43b620b477e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.7 Darwin/23.0.0
|
Release files / mfn-0.1.0-py3-none-any.whl
| Download URL | mfn-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b4342be2b9b739176a6981cf982f380d21259b8c91484c68692abd4a3ab72e3
|
|
BLAKE2b-256 checksum How to use checksums |
2e7e89d1fa490f58a744c5e04240718c8f291f164c3b26e9256f0da090f7fe72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.7 Darwin/23.0.0
|
Security for mfn 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.