View source: R/stationarity_test.R
stationarity_test | R Documentation |
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).
stationarity_test(
X,
statistic = "Tn",
critical = c("simulation", "resample"),
perm_method = "separate",
M = 1000,
blocksize = 2 * ncol(X)^(1/5),
TVE = 1,
replace = TRUE,
return.info = FALSE
)
X |
A dfts object or data which can be automatically converted to that
format. See |
statistic |
String for test statistic. Options are integrated ( |
critical |
String for method of determining the critical values. Options
are |
perm_method |
String for method of resampling. Options are |
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 |
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. |
return.info |
Boolean if all information on test statistic and null distribution should be returned or just the p-value (default). |
List with the following elements:
pvalue: p-value for the stationarity test.
statistic: test statistic from the test.
simulations: simulations which define the null distribution.
Horvath, L., Kokoszka, P., & Rice, G. (2014). Testing stationarity of functional time series. Journal of Econometrics, 179(1), 66-82.
res <- stationarity_test(
generate_brownian_motion(100, v = seq(0, 1, length.out = 20)),
critical = "resample", statistic = "Mn"
)
res2 <- stationarity_test(electricity)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.