Apologies if this question is vague, I've gone over how to word it several times in my head, and I'm not sure it gets clearer each time.
I've been looking at this website article https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing and have been investigating the code for the Hurst exponent in Python. The article gives a code snippet of Python as follows (to calculate Hurst):
def hurst(ts): """Returns the Hurst Exponent of the time series vector ts""" # Create the range of lag values lags = range(2, 100) # Calculate the array of the variances of the lagged differences tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags] # Use a linear fit to estimate the Hurst Exponent poly = polyfit(log(lags), log(tau), 1) # Return the Hurst exponent from the polyfit output return poly*2.0
Which works great, but because of my annoying personality where I need to understand something before I use it, I've been driving myself nuts for a day and a half trying to understand how this code has been developed/derived (especially the sqrt(std) part). The article itself does have some brief steps, but I'm not able to follow them. It may be that I don't quite understand the <| ..... |> notation means and how it can relate to standard deviation. Attached here:
Can anyone provide a link to an article, website or paper that shows from what principles this calculation could have been derived? From Racine's paper I'm aware that Hurst's original method was the RS method, but I believe the method used in the code is from the generalized Hurst exponent or Standard method.
My mathematics isn't at pHd level, but I do have an Engineering degree, so it's not totally useless either. What I am having a huge problem understanding is why the code uses the square root of standard deviation, so if anyone could shed some light on that, it would be greatly appreciated.
Thanks for your time, apologies again if this isn't totally clear.