1function H = boxper(sequence,isplot,boxnumber)
3%
'boxper' estimate the hurst parameter of a given sequence with modified
7% sequence: the input sequence
for estimate
8% isplot: whether display the plot. without a plot
if isplot equal to 0
10% H: the estimated hurst coeffeient of the input sequence
13% Version 1.0, 03/10/2008
26if boxnumber < 30 || boxnumber > 100
27 error(
'The input argument boxnumber must be a integer between [30,100]');
32P_origin = abs(Xk).^2/(2*pi*n);
33P = P_origin(1:floor(n/2)+1);
35cut_min = ceil(0.001*n/2);
36M = floor(logspace(log10(cut_min),log10(0.1*n-cut_min),boxnumber+1));
44 m2 = M(i+1) + cut_min;
45 x(i) = log10((pi * (m2 - m1))/(n));
46 y(i) = log10(sum(
P(m1:m2))/(m2-m1+1));
53H = (1-(Yfit(end)-Yfit(1))/(X(end)-X(1)))/2;
58 plot(X,Yfit,
'r-',
'LineWidth',2);
59 xlabel(
'Log10(Frequency)'),ylabel(
'Log10(Periodogram)'),title(
'Boxed Periodogram Method');