2
$\begingroup$

In my Forecasting class I just learned about the Runs test, which looks at the frequency of runs of a binary data set. The null hypothesis in this case is that the series is random, and if there was a trend in the sequence the series would have a pattern if it was above or below its mean.

For example, we could take the continuous time series to a binary one and then used runs.test() from the tseries library like so :

> library(tseries) 
> x <- diff(diff(USAccDeaths, lag=12)) 
> y <- factor(sign(x - mean(x))) 
> runs.test(y)

Runs Test

data: y 
Standard Normal = 0.2439, p-value = 0.8073 
alternative hypothesis: two.sided

I was curious as to whether there are any concrete forms or examples of non-stationarity that would exhibit long runs under this test, as I'm trying to understand the real value of it or where it may come in particularly useful.

$\endgroup$

2 Answers 2

3
$\begingroup$

Well non-stationarity in mean is one of the examples. If you add linear trend to random data (stationary data to be precise), then this test would definitely find the pattern, since positive trend eventually will force all the values of the series be above the mean:

> x <- 1:1000+rnorm(1000)
> y <-factor(sign(x-mean(x)))
> runs.test(y)

    Runs Test

data:  y
Standard Normal = -31.575, p-value < 2.2e-16
alternative hypothesis: two.sided
$\endgroup$
1
  • $\begingroup$ Ohh, I didn't really think of it like that, evidently. Thanks! $\endgroup$
    – miradulo
    Nov 20, 2015 at 16:15
1
$\begingroup$

Many examples of "long run" behavior can be drawn from engineering, hydrology and climate change.

One approach is the Hurst exponent, H. Developed by an English hydrologist working on the construction of the Aswan Dam on the Nile River in Egypt, it was used to calculate the dam height needed to protect against flooding. Bear in mind that the Egyptians, in what was likely the first-ever time series, began tracking the height of the Nile in the 8th c. and continued recording these measurements for centuries.

Studying an Egyptian 847-year record of the Nile River's overflows, Hurst observed that flood occurrences could be characterized as persistent, i.e. heavier floods were accompanied by above average flood occurrences, while below average occurrences were followed by minor floods...Hurst developed the coefficient * H* as an index for the persistence of the time series considered. For * 0.5H used by practitioners is this: * H* may be interpreted as the chance of movements with the same sign. For * H>0.5*, it is more likely that an upward movement is followed by a movement of the same (positive) sign, and a downward movement is more likely to be followed by another downward movement. For * H<0.5*, a downward movement is more likely to be reversed by an upward movement thus implying the reverting behavior.

http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xfghtmlnode99.html

http://www.bearcave.com/misl/misl_tech/wavelets/hurst/

Another example based on extreme value modeling concerns estimating the height needed to protect the country of Holland from flooding caused by North Sea storm surges. Bear in mind that much of Holland is below sea level and is able to exist only due to the extensive dyke and levee system that's been in place for centuries. Like the Egytians, the Dutch have also been tracking flood heights for centuries, in their case for over 400 years. In the 50s, a storm surge eclipsed all previous levels, flooding much of the country, killing thousands. Using a "block maxima" approach to extreme value modeling, the Dutch estimated the height required to protect them against a 1 in 10,000 year surge and rebuilt the levee system to those specs. Today, as a bulwark against trends in global warming, the Dutch are again rebuilding this system around Amsterdam and Rotterdam to a 1 in 100,000 year event.

https://en.wikipedia.org/wiki/Flood_control_in_the_Netherlands

http://www.nytimes.com/2013/02/17/arts/design/flood-control-in-the-netherlands-now-allows-sea-water-in.html?_r=0

http://www.iac.ethz.ch/edu/courses/master/electives/acwd/Xstat.pdf

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.