Skip to main content

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.

Metadata

Release files for hurst-exponent 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hurst-exponent 0.1.1
File Size Uploaded
hurst_exponent-0.1.1.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hurst-exponent 0.1.1
File Interpreter ABI Platform
hurst_exponent-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / hurst_exponent-0.1.1.tar.gz

Download URL hurst_exponent-0.1.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
38e678401df0ae9b18dcd559a0bb8a5be9753e0bf7fdaf961d473dfe500c5330
BLAKE2b-256 checksum
How to use checksums
6a60c8bce1962c6708b5bdc0936458390f2ef13e4a9a872564d568502f8f79da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.4.0

Release files / hurst_exponent-0.1.1-py3-none-any.whl

Download URL hurst_exponent-0.1.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
482238ee4e631ab765b6773f0b6633dbb9d78d0268a0256cf1c4888dceb447cf
BLAKE2b-256 checksum
How to use checksums
1817b26cb6453904cea31c6d4d0e3ed6244cad2a89ec4619599ab2788cbe1231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.4.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page