Rescaled Range Analysis

The Rescaled Range Analysis (R/S analysis) is the original method of Hurst (1951), applied to prices by Mandelbrot and Wallis (1969) and Peters (1994). It measures how far the cumulative sum of the returns wanders from its trend within a window, in units of the standard deviation of the window, and how that range grows with the length of the window.

The formula for the Rescaled Range Analysis starts from the profile of a window of n log returns x: the cumulative sum of their deviations from the window mean, for \(k = 1\), …, n:

\[Y_{k} = \sum_{i=1}^{k} \left(x_{i} - \operatorname{mean}\left(x\right)\right)\]

The rescaled range of the window is the range of that profile divided by S, the standard deviation of the returns in the window (with n in the denominator):

\[\text{RS} = \frac{\max\left(Y\right) - \min\left(Y\right)}{S}\]

Average RS(n) is the average of RS over the floor(N / n) windows of n returns that fit in the N returns. The exponent H is the slope of its logarithm on that of the window length, with Slope(y, x) the least squares slope of y on x over the window lengths n:

\[H = \text{Slope}\left(\ln\left(\text{Average RS}(n)\right), \ln\left(n\right)\right)\]

In short windows the rescaled range of independent returns grows faster than the square root of n, which pushes H above 0.5. The correction of Anis and Lloyd (1976), as modified by Peters (1994), subtracts the expected rescaled range of independent normal returns and adds 0.5, with Gamma the gamma function and pi the circle constant:

\[\text{Expected RS}(n) = \frac{\left(\frac{n - 0.5}{n}\right) \cdot \Gamma\left(\frac{n - 1}{2}\right)}{\sqrt{\pi} \cdot \Gamma\left(\frac{n}{2}\right)} \cdot \sum_{i=1}^{n - 1} \sqrt{\frac{n - i}{i}}\] \[\text{Corrected H} = 0.5 + \text{Slope}\left(\ln\left(\text{Average RS}(n)\right) - \ln\left(\text{Expected RS}(n)\right), \ln\left(n\right)\right)\]

A Corrected H above 0.5 is a trending and below 0.5 a mean-reverting price. The rescaled range also responds to short-term autocorrelation, so a value above 0.5 does not by itself prove long memory (Lo, 1991).

The Hurst Exponent (H) measures the long-term memory of a series: whether a move tends to be followed by a move in the same direction or by a reversal. Harold Edwin Hurst found it in the yearly floods of the Nile, whose wet and dry years cluster more than independent years would, and Benoit Mandelbrot carried it over to prices. Each method measures how fast some spread of the price path grows with the horizon: for a random walk it grows with the square root of the horizon, which gives \(H = 0.5\). The Hurst Exponent is interpreted as follows:

  • \(H < 0.5\): the series is mean-reverting (anti-persistent).
  • \(H = 0.5\): the series is a random walk (no memory).
  • \(H > 0.5\): the series is trending (persistent).

For liquid stocks the estimate is usually close to 0.5, and from daily data over short horizons it describes short-term behaviour only. A value slightly away from 0.5 over a few years is usually within the estimation noise rather than evidence of a tradable pattern, so the exponent is mostly of use to compare assets with each other or a rolling estimate over time.

Also known as: R/S analysis, rescaled range, R/S Hurst exponent, classic Hurst exponent.

In the Finance Toolkit this is get_hurst_exponent with method="rescaled_range", the same function as Hurst Exponent.

Example · EURUSD, GCUSD, BTCUSD · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_hurst_exponent:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["EURUSD", "GCUSD", "BTCUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.risk.get_hurst_exponent(method="rescaled_range")

Which returns:

References

  • Paper Hurst, H.E. (1951). “Long-term storage capacity of reservoirs.” Transactions of the American Society of Civil Engineers, 116, 770-799.
  • Paper Mandelbrot, B.B. and Wallis, J.R. (1969). “Robustness of the Rescaled Range R/S in the Measurement of Noncyclic Long Run Statistical Dependence.” Water Resources Research, 5(5), 967-988.
  • Paper Anis, A.A. & Lloyd, E.H. (1976). “The expected value of the adjusted rescaled Hurst range of independent normal summands.” Biometrika, 63(1), 111-116.
  • Paper Peters, E.E. (1994). “Fractal Market Analysis.” Wiley.
  • Paper Lo, A.W. (1991). “Long-Term Memory in Stock Market Prices.” Econometrica, 59(5), 1279-1313.
  • Library Referenced against nolds’ hurst_rs (Rescaled Range Analysis)
Share