Anti-presistent series and its Hurst Exponent

by

 

Ant-persistent serie

[p]=randwalkDio(n)
function [p]=randwalkDio(n)
%
p = zeros(n,1);
rand('state',sum(100*clock));
p(1) = 0.0;
for i=1:n-1
% test to see whether step 
% forward or step back
  va=rand;
  if(va >= 0.5)
    p(i+1) = va + va/i^2;
  else
    p(i+1) = va - va/i^2;
  end
end
%
%  Plot the results.
%
figure(2);
  plot ( 1:n, p, 'k-', 'LineWidth', 2 );

  title ( '1D Random Walk' )
  xlabel ( 'Time' )
  ylabel ( 'Distance' )
  %

Contact us