Research article: Hurst Exponent for Market Regime Detection

Ed
4 min readJan 16, 2020

The goal of this article is to explain how the Hurst exponent can be used to classify a set of data into three categories: Mean-Reverting, Random Walk or Trending.

What is the Hurst Exponent?

The Hurst exponent provides a measure for long-term memory and fractality of a time series. It quantifies the relative tendency of a time series either to regress strongly to the mean or to cluster in a direction.

The values of the Hurst exponent range between 0 and 1. Based on the Hurst exponent value H, a time series can be classified into three categories:

  • H < 0.5 indicates a mean-reverting series. This means a high value is followed by a low value and vice-versa. The closer H is to 0, the stronger the mean reversion process is.
  • H = 0.5 indicates a geometric random walk.
  • H > 0.5 indicates a trending series. A high value is followed by a higher one. A strong trend indicates an H value closer to 1.

The image below shows 3 different time series with their respective H :

Coding the Hurst Exponent

The function takes 2 parameters (ts,n). ts stands for time series, it’s an array with the closing prices of a stock. n is the time window used for the lags.

The Hurst exponent is very related to autocorrelation as it compares future time windows of data with past time windows of data. This is what we are using the lags for.

The function iterates through each lag while creating an array storing the difference of the prices, i.e… If lag = 2, store in the array the value of the stock minus the stock price 2 days ago. Then compute the variance of this value and store it into variances, repeat this n times.

Now use polyfit to find the slope of the line between the log of lags and the log of the variances. Then divide by 2 to get the H.

Analyzing S&P stocks with the Hurst Exponent

I have developed a scanner for the classification of the S&P 500 stocks to know which ones were strongly mean-reverting and which ones were strongly trending during 2019–2020.

There were 261 working days in 2019, so I ran two different scans, one using lags with a time window(n) of 1 month (21 days) and the other one with 6 months (130 days).

First scan

The image below shows the results for the first scan (1 month):

Interpretation:

For the time period analyzed (2019–2020) with the Hurst Exponent using a time window of 21 days for the lags…

The normal distribution chart shows that:

  • ~82% of the S&P 500 stocks were random walking (0.4 < H < 0.6)
  • ~16% were mean-reverting (H < 0.4)
  • ~2% were trending (0.6 < H)

The most mean-reverting instrument was SO with H=~0.2 and the most trending was XRX with H=~0.67. Although XRX is closer to being a Random Walk (H=~0.5) than a Trending series (H=~1).

Let's check if the results for SO and XRX are accurate:

SO (2019–2020)
XRX (2019–2020)

SO indeed had a stronger mean-reverting factor for the time window provided (21 days) than XRX.

At first glance, it feels like SO had a stronger trend factor than XRX. This could be the case if instead of a time window of 21 days I used a longer time window.

The Zig-Zag indicator shows that SO had more swings and their lengths were smaller than the XRX ones.

Second scan

Using a time window of 6 months for the lags.

Interpretation:

For the time period analyzed (2019–2020) with the Hurst Exponent using a time window of 130 days for the lags…

The normal distribution chart shows that:

  • ~84% of the S&P 500 stocks were mean-reverting (H < 0.4)
  • ~16% were random walking (0.4 < H < 0.6)
  • ~0% were trending (0.6 < H)

The strongest mean-reverting stocks were CTVA and GILD, with H=~0.02.

CTVA (2019–2020)
GILD (2019–2020)

Conclusion

As seen in the normal distribution charts, the Hurst Exponent feels a bit biased for mean-reversion regardless of the time window used for the lag.

Despite that fact, it did the job pretty well, given the small amount of data fed to the algorithm (just 1 year).

Nevertheless, I ran multiple scans using different time windows — up to n = 1000 and 10 years of data — and I wasn’t able to find any strong trending time series(stock). Most of them were a either a Geometric Brownian motion (0.4 < H < 0.6) or mean-reverting (H < 0.4).

--

--