Type: Package
Title: Stationarity Test Based on Unsystematic Sub-Sampling
Version: 0.2.1
Maintainer: Haeran Cho <haeran.cho@bristol.ac.uk>
Description: Performs a test for second-order stationarity of time series based on unsystematic sub-samples.
License: GPL-2
Suggests: RcppArmadillo
Imports: Rcpp (≥ 0.12.10), doParallel, foreach, iterators
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.3.1
Encoding: UTF-8
NeedsCompilation: yes
Author: Haeran Cho [aut, cre]
Repository: CRAN
Packaged: 2025-04-04 21:14:35 UTC; mahrc
Date/Publication: 2025-04-04 21:30:02 UTC

A second-order stationarity of time series based on unsystematic sub-samples

Description

The function implements a stationarity test procedure, where the main statistic is obtained from measuring the difference in the second-order structure over pairs of randomly drawn intervals. Maximising the main statistics after AR Sieve bootstrap-based variance stabilisation, the test statistic is obtained which is reported along with the corresponding pair of intervals and the test outcome.

Usage

unsys.station.test(
  x,
  M = 2000,
  sig.lev = 0.05,
  max.scale = NULL,
  m = NULL,
  B = 200,
  eps = 5,
  use.all = FALSE,
  do.parallel = 0
)

Arguments

x

input time series

M

number of randomly drawn intervals

sig.lev

significance level between 0 and 1

max.scale

number of wavelet scales used for wavelet periodogram computation; max.scale = NULL activates the default choice (max.scale = round(log(log(length(x), 2), 2)))

m

minimum length of a random interval; m = NULL activates the default choice (m = round(sqrt(length(x))))

B

bootstrap sample size

eps

a parameter used for random interval generation, see the supplementary document of Cho (2016)

use.all

if use.all=TRUE, all M*M pairs of random intervals are considered in test statistic computation; if use.all=FALSE, only 10*M pairs are used; regardless, the whole M*M pairs are considered in test criterion generation

do.parallel

number of copies of R running in parallel, if do.parallel = 0, %do% operator is used, see also foreach

Value

intervals

a pair of intervals corresponding to the test statistic, exhibiting the most distinct second-order behaviour

test.stat

test statistic

test.criterion

test criterion

test.res

if test.res=TRUE, the null hypothesis of stationarity is rejected at the given significance level

References

H. Cho (2016) A second-order stationarity of time series based on unsystematic sub-samples. Stat, vol. 5, 262-277.

Examples

## Not run: 
x <- rnorm(200)
unsys.station.test(x, M=1000)

## End(Not run)