Skip to contents

Stationarity test for functional time series with different methods on determining the critical values of the test statistic. The Monte Carlo method was constructed in Horvath et al. (2014), while the resample-based methods have not been validated in the literature (use the provided option at your discretion).

Usage

stationarity_test(
  X,
  statistic = "Tn",
  critical = c("simulation", "resample"),
  perm_method = "separate",
  M = 1000,
  blocksize = 2 * ncol(X)^(1/5),
  TVE = 1,
  replace = TRUE
)

Arguments

X

A dfts object or data which can be automatically converted to that format. See dfts().

statistic

String for test statistic. Options are integrated (Tn) and supremum (Mn). The default is Tn.

critical

String for method of determining the critical values. Options are simulation and resample. Default is simulation.

perm_method

String for method of resampling. Options are separate for block resampling and overlapping for sliding window. Default is separate.

M

Numeric for number of simulation to use in determining the null distribution. Default is 1000.

blocksize

Numeric for blocksize in resample test. Default is \(2N^{1/5}\).

TVE

Numeric for total variance explained when using PCA for eigenvalues. Default is 1.

replace

Boolean if replacement should be used for resample test. Thus, this defines if a bootstrapped or permuted test is used. Default is TRUE.

Value

List with the following elements:

  1. pvalue: p-value for the stationarity test.

  2. statistic: test statistic from the test.

  3. simulations: simulations which define the null distribution.

References

Horvath, L., Kokoszka, P., & Rice, G. (2014). Testing stationarity of functional time series. Journal of Econometrics, 179(1), 66-82.

Examples

res <- stationarity_test(
  generate_brownian_motion(100,v=seq(0,1,length.out=20)),
  critical='resample', statistic='Mn')
res2 <- stationarity_test(electricity)