Implement hurst exponent function