Compute the Hurst index on historical prices
H=hurst(price [,period [,step]]);
Given the historical prices of an asset the function computes the so-called Hurst index (or Hurst exponent) for fractional Brownian motion on the asset returns.
If the Hurst index H is 0.5, then the price process is a "regular" Brownian motion; if H>0.5, then the increments of the process are positively correlated; finally, if H<0.5, the increments of the process are negatively correlated.
The function also shows a scatter plot of the log of the sample length against the log of the variation coefficient of asset returns.
First we generate 1000 log-normally distributed daily prices for an asset whose initial values is 25 euros. First step is the creation of 1000 normal random variables (with mean 0.1/250 and standard deviation 0.2/sqrt(250))
-->M=grand(1000,1,'nor',0.1/250,0.2/sqrt(250));
Then we create the prices
-->S=exp(cumsum(M,1))*25;
Now we are ready to use the function. We use it on the first 100 prices and with a step of 10 days
-->H=hurst(S,100,10)
H = 0.5588872
We have a value close to 0.5 which means that the data should be more or less follow a Brownian motion.
Francesco Menoncin - Brescia University - 2010