Calculates the rescaled range analysis.
14 Downloads
Updated 06 Jan 2004
No LicenseAccorting to the references the Rescaled Range Analysis can reveal non-periodic cycles time series. It has found many applications on the financial time series, although the underlying theory is not convincing. This m-file contains the basic algorithm and 4 proposed variations. The estimation of the Hurst exponents is up to the user.
BenSN (view profile)
Could someone explain how to imput the "n" vector? Thanks!
PJ (view profile)
Something to be aware of - originally Hurst calculated the std using 1/n rather than 1/(n-1). 1/(n-1) is the default option when using std in MATLAB.
BAPPA MUKHERJEE (view profile)
thanks
maryam mohamadi (view profile)
thanksssssssss
very much
Eva (view profile)
Please help me! could somebody please explain me shortly how does it works? I am new at matlab so it is dificult for me, but I need to calcule some time series by this method, hope You will help me.
Best regards
Eva
Lars (view profile)
I'm having some issues producing an output. Am I supposed to remove some ; or something? My intentions are to make a log(RS) log(n) plot. The program only yields a single number which doesn't make any sense.
Any help much appreciated.
-Lars
Joris (view profile)
Thanks for the function.
The case when x(t)=0 for some period greater than the length of a block should be treat separately, if not it gives a 0/0 division.
How to compute the lag time vector to plot the pox plot of R/S ? I try lag(i)=log10(N/n(i)) but it gives strange result (decreasing function...)
Help !
And Thks !
Joris
i'm studend in ITS (Institut teknologi sepuluh Nopember) Surabaya in Indonesia.
i'm interest to sdudied fractal (mono and multi) analysis for well-log analysis.
thank's for this source code.
Needs some small fixes, I gave it simulated fBm time series and put them in the routine, but the slopes did not evaluate to the H exponent. I found that the routine is missing the first step taking log(Ni+1/Ni) of the time series. Also, autocorr(x,1) I replaced as xcorr(x)...maybe my version. Now it is giving meaningful data. Otherwise, a great reoutine and saves lots of time typing up the bulk of the code....THANKS!!!
Very useful! Just a notice (at least for the Lo method): the variation seems to be the unbiased one (i.e. the cross-product sums are divided by the degrees of freedom, instead of the full period length).
I forgot to mention one thing: If you wish to compute the log E(R/S) using the Anis and Lloyd (1976) formula, you may use the following code at line 190:
logERS(i,1)=log10((gamma(0.5*(n(i)-1))/(sqrt(pi)*gamma(.5*n(i))))*s)
However, for n < 340 the gamma value become to large and might not give you an estimate. I therefore suggest to switch to Peters' formula for n<340.
Thomas
nice
The program calculates the rescaled range, the expected value, and the V-statistic. One just needs to determine the cycle length (if any) and set up the regression accordingly. The slope of the regression equation is the Hurst exponent.
With the expected value for R/S, one can easily test the significance of the results.
Overall a very good and handy routine.
Thomas