hurstexp(x) calculates the Hurst exponent of a time series x using R/S analysis, after Hurst, withslightly different approaches, or corrects it with small sample bias, see for example Weron.These approaches are a corrected R/S method, an empirical and corrected empirical method, anda try at a theoretical Hurst exponent. It should be mentioned that the results are sometimes verydifferent, so providing error estimates will be highly questionable.Optimal sample sizes are automatically computed with a length that possesses the most divisorsamong series shorter than x by no more than 1 percent.