RSSTATISTIC Procedure |
@RSStatistic computes the R/S (rescaled range) statistic for a single sample. It can either compute the classical R/S statistic from Mandelbrot and Wallis(1969), or Lo(1991)'s modified version. This is used in analyzing long-term memory of a process.
@RSStatistic( options ) x start end
Parameters
|
series |
series to analyze |
|
start end |
range of series to use. By default, the defined range of series. |
Options
CLASSICAL/[NOCLASSICAL]
If CLASSICAL, it computes the classical form (range divided by sample standard deviation). If NOCLASSICAL (the default) it computes Lo's modified form, where the scale is the square root of the long-run variance. Lo's statistic is also divided by the square root of the number of observations.
LAGS=Bartlett window width for computing Lo's statistic [sqrt(observations)]
Notes
Because the R/S statistic is usually computed for many different samples, this procedure doesn't display any output. Instead, use it to do the number-crunching, and retrieve the result with %CDSTAT.
Variables Defined
|
%CDSTAT |
Calculated R/S statistic |
Example
*
* Replication file for Willinger, Taqqu and Teverovsky(1999), "Stock
* Market Prices and Long-Range Dependence", Finance and Stochastics, vol
* 3 pp 1-13.
*
open data d-vwew.dat
data(format=free,org=columns) 1 6409 date vw ew
graph(header="Trace of the Equal-Weighted CRSP daily data")
# ew
@hurst(header="R/S Analysis of Equally-Weighted Returns") ew
*
set vq 1 101 = 0.0
set xq 1 101 = t+1
source rsstatistic.src
do q=0,100
@RSStatistic(lags=q) ew
compute vq(q+1)=%cdstat
end do q
scatter(header="Fig 2b. V(q) for the EW series on a log-log scale",$
style=line,vlabel="V(q)",hlabel="q",vlog=2,hlog=4)
# xq vq
Copyright © 2026 Thomas A. Doan