Learn R Programming

costat (version 1.1-1)

TOSts: A test statistic for stationarity

Description

The $T_{\mbox{vS}}$ test statistic from the Cardinali and Nason article. Measures the degree of non-stationarity using the estimated evolutionary wavelet spectrum (EWS)

Usage

TOSts(spec)

Arguments

spec
An EWS estimate, e.g. from the $S component from ewspec

Value

  • A single number which is the sum of the sample variances of each scale level from an EWS estimate. If the EWS estimate is constant for each scale then the return value is zero.

Details

Given an EWS estimate. This computes the sample variance of the estimate for each scale level and then returns the sum of these variances.

References

`Costationarity and stationarity tests for stock index returns' by Cardinali and Nason.

See Also

myTOS

Examples

Run this code
#
# Compute a spectral estimate on an sample time series (just use iid data)
#
x <- rnorm(128)
xews <- ewspec(x, WPsmooth=TRUE, smooth.dev=var)$S
#
# You could plot this spectral estimate if you liked
#
plot(xews)
#
# Compute test statistic
#
TOSts(xews)
#[1] 0.1199351
#
# Although the time series x here is a realization from a stationary process
# the test statistic is not zero (this is because of the estimation error
# inherent in this small sample). 
#
# This is why the bootstrap test, \code{\link{myTOS}} is required to
# assess the significance of the test statistic value.

Run the code above in your browser using DataLab