Learn R Programming

fChange (version 2.1.0)

kpss_test: Functional KPSS Test

Description

Compute the Kwiatkowski–Phillips–Schmidt–Shin (KPSS) statistic for functional data.

Usage

kpss_test(
  X,
  method = c("simulation", "resample"),
  resample_blocks = "separate",
  M = 1000,
  blocksize = 2 * ncol(X)^(1/5),
  TVE = 1,
  replace = TRUE,
  return.info = FALSE
)

Value

List with the following elements:

  1. pvalue: p-value from the test.

  2. statistic: test statistic computed on the data.

  3. simulations: Theoretical values for the null distribution.

Arguments

X

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

method

String for the method in computing thresholds: Monte Carlo simulation (simulation) or resampling (resample).

resample_blocks

String indicating the type of resample test to use. Using separate gives blocks which are separate while overlapping creates overlapping or sliding windows. When blocksize=1 then these will be identical.

M

Number of simulations to estimate theoretical distribution.

blocksize

Numeric for the block size when using a resample test.

TVE

Numeric for pca() to select the number of principle components.

replace

Boolean to indicate if blocks should be selected with replacement when using a resample test.

return.info

Boolean if all information on test statistic and null distribution should be returned or just the p-value (default).

References

Chen, Y., & Pun, C. S. (2019). A bootstrap-based KPSS test for functional time series. Journal of Multivariate Analysis, 174, 104535.

Kokoszka, P., & Young, G. (2016). KPSS test for functional time series. Statistics, 50(5), 957-973.

Examples

Run this code
kpss_test(generate_brownian_motion(100, v = seq(0, 1, length.out = 20)))
kpss_test(generate_brownian_motion(100, v = seq(0, 1, length.out = 20)),
  method = "resample", resample_blocks = "overlapping"
)

Run the code above in your browser using DataLab