All Projects → Mottl → Hurst

Mottl / Hurst

Licence: mit
Hurst exponent evaluation and R/S-analysis in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Hurst

Bitmap
C++ Bitmap Library
Stars: ✭ 125 (-15.54%)
Mutual labels:  fractal
Awesome Ts Anomaly Detection
List of tools & datasets for anomaly detection on time-series data.
Stars: ✭ 2,027 (+1269.59%)
Mutual labels:  time-series
Friartuck
Live Quant Trading Framework for Robinhood, using IEX Trading and AlphaVantage for Free Prices.
Stars: ✭ 142 (-4.05%)
Mutual labels:  time-series
Lindenmayer
Feature complete classic L-System library (branching, context sensitive, parametric) & multi-purpose modern L-System/LSystem implementation that can take javascript functions as productions. It is not opinionated about how you do visualisations.
Stars: ✭ 125 (-15.54%)
Mutual labels:  fractal
Jhtalib
Technical Analysis Library Time-Series
Stars: ✭ 131 (-11.49%)
Mutual labels:  time-series
Survival Analysis Using Deep Learning
This repository contains morden baysian statistics and deep learning based research articles , software for survival analysis
Stars: ✭ 139 (-6.08%)
Mutual labels:  time-series
Timescaledb
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
Stars: ✭ 12,211 (+8150.68%)
Mutual labels:  time-series
Tscv
Time Series Cross-Validation -- an extension for scikit-learn
Stars: ✭ 145 (-2.03%)
Mutual labels:  time-series
Voice activity detection
Voice Activity Detection based on Deep Learning & TensorFlow
Stars: ✭ 132 (-10.81%)
Mutual labels:  time-series
Matrixprofile
A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone.
Stars: ✭ 141 (-4.73%)
Mutual labels:  time-series
Stldecompose
A Python implementation of Seasonal and Trend decomposition using Loess (STL) for time series data.
Stars: ✭ 130 (-12.16%)
Mutual labels:  time-series
Indicators.jl
Financial market technical analysis & indicators in Julia
Stars: ✭ 130 (-12.16%)
Mutual labels:  time-series
Data science blogs
A repository to keep track of all the code that I end up writing for my blog posts.
Stars: ✭ 139 (-6.08%)
Mutual labels:  time-series
Simplestockanalysispython
Stock Analysis Tutorial in Python
Stars: ✭ 126 (-14.86%)
Mutual labels:  time-series
Sweep
Extending broom for time series forecasting
Stars: ✭ 143 (-3.38%)
Mutual labels:  time-series
Imhotep
Imhotep is a large-scale analytics platform built by Indeed.
Stars: ✭ 125 (-15.54%)
Mutual labels:  time-series
Laravel Fractal
An easy to use Fractal wrapper built for Laravel and Lumen applications
Stars: ✭ 1,748 (+1081.08%)
Mutual labels:  fractal
Anomaly detection tuto
Anomaly detection tutorial on univariate time series with an auto-encoder
Stars: ✭ 144 (-2.7%)
Mutual labels:  time-series
Scipy con 2019
Tutorial Sessions for SciPy Con 2019
Stars: ✭ 142 (-4.05%)
Mutual labels:  time-series
Pyodds
An End-to-end Outlier Detection System
Stars: ✭ 141 (-4.73%)
Mutual labels:  time-series

hurst

Hurst exponent evaluation and R/S-analysis

Python 2.7 Python 3x Build Status pypi Downloads

hurst is a small Python module for analysing random walks and evaluating the Hurst exponent (H).

H = 0.5 — Brownian motion,
0.5 < H < 1.0 — persistent behavior,
0 < H < 0.5 — anti-persistent behavior.

Installation

Install hurst module with
pip install hurst
or
pip install -e git+https://github.com/Mottl/hurst#egg=hurst

Usage

import numpy as np
import matplotlib.pyplot as plt
from hurst import compute_Hc, random_walk

# Use random_walk() function or generate a random walk series manually:
# series = random_walk(99999, cumprod=True)
np.random.seed(42)
random_changes = 1. + np.random.randn(99999) / 1000.
series = np.cumprod(random_changes)  # create a random walk from random changes

# Evaluate Hurst equation
H, c, data = compute_Hc(series, kind='price', simplified=True)

# Plot
f, ax = plt.subplots()
ax.plot(data[0], c*data[0]**H, color="deepskyblue")
ax.scatter(data[0], data[1], color="purple")
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_xlabel('Time interval')
ax.set_ylabel('R/S ratio')
ax.grid(True)
plt.show()

print("H={:.4f}, c={:.4f}".format(H,c))

R/S analysis

H=0.4964, c=1.4877

Kinds of series

The kind parameter of the compute_Hc function can have the following values:
'change': a series is just random values (i.e. np.random.randn(...))
'random_walk': a series is a cumulative sum of changes (i.e. np.cumsum(np.random.randn(...)))
'price': a series is a cumulative product of changes (i.e. np.cumprod(1+epsilon*np.random.randn(...))

Brownian motion, persistent and antipersistent random walks

You can generate random walks with random_walk() function as following:

Brownian

brownian = random_walk(99999, proba=0.5)

Brownian motion

Persistent

persistent = random_walk(99999, proba=0.7)

Persistent random walk

Antipersistent

antipersistent = random_walk(99999, proba=0.3)

Antipersistent random walk

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].