I am trying to test Hurst exponent in different time lag range. However, i got negative values in some time lag range which is weird, because the Hurst exponent should have values within the range from 0 to 1.

This is the Python code to calculate the Hurst exponent:

*calculate Hurst*
lag1 = 2
lags = range(lag1, 20)

tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags]

plot(log(lags), log(tau)); show()
m = polyfit(log(lags), log(tau), 1)

hurst = m[0]*2

print 'hurst = ',hurst

When lags = range(200,300), the Hurst exponent is -0.035. My data length is 1643. The log-log plot looks like this, which is not linear: enter image description here

Is there something wrong with the code or anyone know any good package to test hurst exponent in R or python?

  • $\begingroup$ I got similar results on some indices when I looked at this too. What underlying are you taking returns of? $\endgroup$
    – will
    Oct 25 '19 at 13:22
  • $\begingroup$ I am using Shanghai composite Index $\endgroup$
    – Lori Li
    Oct 25 '19 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.