4
$\begingroup$

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?

$\endgroup$
2
  • $\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, 2019 at 13:22
  • $\begingroup$ I am using Shanghai composite Index $\endgroup$
    – Lori Li
    Oct 25, 2019 at 18:35

1 Answer 1

0
$\begingroup$

Hurst exponent could be negative due to some data approximations. By design, it should stop at 0. In python, you coul look at hurst repository.

[Reference] https://towardsdatascience.com/introduction-to-the-hurst-exponent-with-code-in-python-4da0414ca52e

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.