Learn R Programming

costat (version 1.1-1)

tstosscan: Perform a series of stationarity tests on a time series at different spans and locations.

Description

A global stationarity test is very useful to examining a whole series to see whether it there is evidence for stationarity. However, sometimes it can be useful to apply the test to portions of the time series. This function does this in an organized way by applying the test to successive, overlapping, portions of a time series, and doing this for different widths of portions (spans).

Usage

tstosscan(ts, spans, Bsims = 100, skipby = 1, verbose = FALSE)

Arguments

ts
The time series to analyze
spans
A vector containing the spans to analyze
Bsims
The number of bootstrap simulations for each stationarity test.
skipby
How far to move the portion for each significance test.
verbose
If TRUE then print out informative messages as the function proceeds.

Value

  • A list containing the following components:
  • spansA copy of the input spans vector which contains the list of portion widths
  • pvallistA list of length length{spans} (ie there is a list component for each span). For each span there is a vector containing the p-values for each test, for each step
  • starlistA list of length length{spans}, the same format as pvallist except that each entry contains the starting index of the portion. So from the starting index, and the span, the coordinates of the whole time series portion can be obtained.

Details

A span or portion of the time series is given by $$X_t$$ to $$X_{t+span}$$. The tests of stationarity are applied to portions such as these. Each test is applied to a different portion ranging from t=1, in steps of skipby, to the highest possible value t so that t+span does not overlap the end of the series.

The function can accept a vector of spans, and the function runs processing one span at a time.

Note that this procedure is an example of a multiple hypothesis test. The tests are all performed individually with the same p-value and there is no correction here for multiple testing.

References

`Costationary and stationarity tests for stock index returns' by Car dinali and Nason, 2008, University of Bristol Technical Report 08:08.

See Also

plottstosscan, myTOS

Examples

Run this code
#
# Compute tests of stationarity on white noise Gaussian
# (not run on installation because its compute intensive)
#
v <- rnorm(128)
v.tstos <- tstosscan(v, spans=c(32,64))

plottstosscan(v, v.rstos, inc=0)

Run the code above in your browser using DataLab