Registry / analytics / hurst
library0.0.5pypypi✓ verified 84d ago

A Python library for estimating the Hurst exponent using Rescaled Range (R/S) analysis. Version 0.0.5. Low release cadence (last update ~2020).

pip install hurst
INSTALL
IMPORT
SIG · HURST
H
hurst
analyticspythonv0.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compute_Hc
from hurst import compute_Hc
import hurst; hurst.compute_Hc(...)
Function is top-level, not a module attribute.

Compute Hurst exponent for a random walk (H~0.5). Use kind='change' for returns, 'price' for price level.

import numpy as np import os from hurst import compute_Hc np.random.seed(42) ts = np.random.randn(1000) H, c, data = compute_Hc(ts, kind='price', simplified=False) print(f'Hurst exponent: {H:.3f}') # Ensure no token needed: os.environ.get('API_KEY', '')
Debug
Known issues
gotchaThe default kind='price' assumes the input is a price series (non-negative). For returns (negative values), use kind='change' or the function will log-transform negative numbers producing NaN.
fix
Pass kind='change' if data contains negative values.
affects: all
gotchasimplified=False returns more detailed output (dict with H, c, data) but simplified=True only returns H. New users often expect a single value but get a tuple.
fix
Set simplified=True if only the exponent is needed: H = compute_Hc(ts, simplified=True).
affects: all
Errors
Common errors & fixes
ValueError: Input series contains negative or zero values. Use kind='change' for returns.
Passing return series (with negative numbers) while using the default kind='price'.
fix
Use kind='change' when your input is returns (can be negative).
NameError: name 'compute_Hc' is not defined
Incorrect import: import hurst then calling compute_Hc without module prefix.
fix
Use 'from hurst import compute_Hc' and call compute_Hc directly.
Upgrade
Version history
0.0.5latest on PyPI · released Feb 7, 2019
Audit
Dependencies
numpyrequiredRequired for array operations in R/S analysis.
scipyoptionalRequired for optional statistical tests like brownian motion.
Agent activity
27 hits · last 30 days
node
26
OpenAI (training)
1
Resources
hurst — pip install hurst · libregistry