Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mfn-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mfn-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for mfn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b756e77add9bde3ea20f43643cde4130374fbc9aed033ac88ca1990ef06e27b
MD5 ae7da7f931ea336ace18f7d796e2b64e
BLAKE2b-256 550eaab23696606ee6cc015b368601812b2ab243373099d50a0b43b620b477e6

See more details on using hashes here.

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

Hashes for mfn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b4342be2b9b739176a6981cf982f380d21259b8c91484c68692abd4a3ab72e3
MD5 567c6b1ab5324fe18a411bd01d749be4
BLAKE2b-256 2e7e89d1fa490f58a744c5e04240718c8f291f164c3b26e9256f0da090f7fe72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page