Skip to main content

Hurst exponent estimator

Project description

Hurst Estimator

Estimate the Hurst exponent of a random variable using robust statistical methods. Our package provides methods to compute the Hurst exponent (a statistical measure of long-term memory) using the standard deviation of sums and a generalized method through the structure function.

Features:

  • Support for both standard and generalized Hurst exponent calculations.
  • Goodness of fit metrics.
  • Interpretation of Hurst exponent values.
  • Ability to plot and visualize fit results.
  • Bootstrap functionality for additional statistics.
  • Compute linear and nonlinear autocorrelation functions (ACF)
  • Test suite test suite is meant to validate the functionality of Hurst exponent estimators.
  • Other hurst estimation methods will be supported in the near future.

This repository is actively being developed and any tickets will be addressed in order of importance. Feel free to raise an issue if you find a problem.

Installation

To get started;

pip install hurst_exponent

Dependencies

Ensure the following dependencies are installed before utilizing the package.

  • numpy
  • pandas
  • powerlaw_function
  • stochastic

Basic Usage

This tells you everything you need to know for the simplest, typical, use cases:

from hurst_exponent import standard_hurst, generalized_hurst

# Define your time series data
series = [...]

# Estimate Hurst Exponent using standard method
hurst_std, fit_std = standard_hurst(series)

# Estimate Hurst Exponent using generalized method
hurst_gen, fit_gen = generalized_hurst(series)

# Print results
print(f"Standard Hurst Exponent: {hurst_std}")
print(f"Generalized Hurst Exponent: {hurst_gen}")

Documentation

Main Functions

standard_hurst(series: np.array, ...):

Compute the Hurst exponent using the standard deviation of sums.

generalized_hurst(series: np.array, ...):

Computes the generalized Hurst exponent using the structure function method.

Utils

  bootstrap(estimator: Callable, ...):

Generates bootstrap samples.

Hurst Estimators Test Suite

Our Hurst Estimators Test Suite ensures the robustness and accuracy of the standard_hurst and generalized_hurst estimators in the context of time series analysis.

Highlights:

Tests various hyperparameter combinations for both the generalized and standard Hurst estimators.

Estimators;
- Simulation: Uses Geometric Brownian Motion (GBM) to simulate data for testing, representing a standard model for stock price movements with a known Hurst of 0.5.

- Bootstrapping: Repeated sampling is employed to create a distribution of Hurst estimates for statistical validation.
Core Tests;
- Unbiasedness: Checks if the estimator accurately identifies a random walk in GBM data.
- Validity: Ensures estimates fall within the [0, 1] range.
- Confidence Intervals: Validates that the 95% CI aligns with bounds cited in major literature.

To delve into the specifics, review the test suite source code.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

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

hurst_exponent-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

hurst_exponent-0.1.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file hurst_exponent-0.1.1.tar.gz.

File metadata

  • Download URL: hurst_exponent-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/22.4.0

File hashes

Hashes for hurst_exponent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 38e678401df0ae9b18dcd559a0bb8a5be9753e0bf7fdaf961d473dfe500c5330
MD5 a75adc3ff952374ab1ba394cb94591dd
BLAKE2b-256 6a60c8bce1962c6708b5bdc0936458390f2ef13e4a9a872564d568502f8f79da

See more details on using hashes here.

File details

Details for the file hurst_exponent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hurst_exponent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/22.4.0

File hashes

Hashes for hurst_exponent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 482238ee4e631ab765b6773f0b6633dbb9d78d0268a0256cf1c4888dceb447cf
MD5 ed35f5a9c7c96c68eb9f26ec3cdd1f9f
BLAKE2b-256 1817b26cb6453904cea31c6d4d0e3ed6244cad2a89ec4619599ab2788cbe1231

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