Learn R Programming

costat (version 2.4.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)

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.

Arguments

spec

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

Author

Guy Nason

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

Cardinali, A. and Nason, Guy P. (2013) Costationarity of Locally Stationary Time Series Using costat. Journal of Statistical Software, 55, Issue 1.

Cardinali, A. and Nason, G.P. (2010) Costationarity of locally stationary time series. J. Time Series Econometrics, 2, Issue 2, Article 1.

See Also

BootTOS

Examples

Run this code
#
# Compute a spectral estimate on an sample time series (just use iid data)
#
xsim <- rnorm(128)
xews <- ewspec(xsim, smooth.dev=var)$S
#
# You could plot this spectral estimate if you liked
#
if (FALSE) 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{BootTOS}} is required to
# assess the significance of the test statistic value.

Run the code above in your browser using DataLab