No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Rescaled Range Analysis

4.5 | 11 ratings Rate this file 24 Downloads (last 30 days) File Size: 5.18 KB File ID: #4325 Version: 1.0
image thumbnail

Rescaled Range Analysis



01 Jan 2004 (Updated )

Calculates the rescaled range analysis.

| Watch this File

File Information

Accorting 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.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (17)
07 Jun 2016 PJ

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.

Comment only


05 Feb 2013 maryam mohamadi

very much

19 Jun 2012 Eva

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

Comment only
29 Oct 2011 Lars

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.


Comment only
17 Feb 2011 Joris

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 !

Comment only
14 Feb 2008 ali gezer


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.

Comment only
15 Nov 2007 Matt Peloso

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!!!

26 Oct 2007 Chris Axioglou

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).

13 Dec 2006 Thomas A. Thiele

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:


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.


Comment only
02 Dec 2006 ZC huang


14 Sep 2006 Thomas A. Thiele

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.


07 Dec 2005 Gabbar Singh

08 Feb 2005 Vahidin Jeleskovic

25 Aug 2004 wai wl

26 Mar 2004 haoqm qm

Contact us