1function H = diffvar(sequence,isplot)
3%
'diffvar' estimate the hurst parameter of a given sequence with
4% difference variance method. The difference variance method can
5% distinguish a non-stationary sequence from a
long-dependence
6% sequence. It
's usually used with aggregate variance method.
9% sequence: the input sequence for estimate
10% isplot: whether display the plot. without a plot if isplot equal to 0
12% H: the estimated hurst coeffeient of the input sequence
15% Version 1.0, 03/10/2008
25M = [floor(logspace(0,log10(mlarge),50))];
33 matrix_sequence = reshape(sequence(1:m*k),m,k);
34 V(i) = var(sum(matrix_sequence,1)/m);
45cut_max = floor(6*n2/10);
46X = x(cut_min:cut_max);
47Y = y(cut_min:cut_max);
51beta = -(Yfit(end)-Yfit(1))/(X(end)-X(1));
57 plot(X,Yfit,'r-
','LineWidth
',2);
58 plot(x(1:cut_min),yfit(1:cut_min),'r:
','LineWidth
',2);
59 plot(x(cut_max:end),yfit(cut_max:end),'r:
','LineWidth
',2);
60 xlabel('Log10(Aggreate Level)
'), ylabel('Log10(Different Viance)
'), title('Different Viance Method
');