I am using this code and getting negative Hurst exponent for OMX index returns between 2010 and 2021. I thought Hurst exponent cannot be negative but I am not sure what am I doing wrong?
def hurst(series):
lags = range(2, 100)
tau = [sqrt(std(subtract(series[lag:], series[:-lag]))) for lag in lags]
poly = polyfit(log(lags), log(tau), 1)
return poly[0]*2.0