cusum_test: Cusum-type test against a change in persistence

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cusum_test.R


This function performs a cusum-type test for a change in persistence as suggested by Leybourne, Taylor, and Kim (2006) and extended by Sibbertsen and Kruse (2009). Under the null hypothesis the time series is nonstationary throughout and under the alternative a change from nonstationary to stationary or vice versa has occured.


cusum_test(x, trend = c("none", "linear"), tau = 0.2, type = c("LKT",
  "SK"), m = 0, simu = 0, M = 10000)



the univariate numeric vector to be investigated. Missing values are not allowed.


whether the time series exhibits a trend, "none" implies no trend and "linear" implies a linear trend.


the function tests in the interval [T*tau,T*(1-tau)] for a break in persistence with T being the length of the time series. It must hold that 0<tau<0.5, default is tau=0.2 as commonly used in the literature. Note that if T*tau<=1+as.numeric(trend=="linear") + (m>3)*(m-3) the test statistic cannot be calculated.


which type of cusum test should be performed, "LKT" for the cusum test by Leybourne, Taylor, and Kim (2006) and "SK" for the extension by Sibbertsen and Kruse (2009). See details.


Number of covariances used for the estimation of the long run variance. Default is m=0.


whether critical values should be simulated or interpolated, simu=1 means simulation, simu=0 means interpolation based on critical values for tau=0.2. See details. Default is simu=0.


number of replications in case critical values should be simulated. Default is M=10000.


Leybourne, Taylor, and Kim (2006) introduced a cusum-type test that is able to identify when time series exhibit changes in persistence. Under the null hypothesis, the series is throughout I(1), i.e. nonstationary. Under the alternative the series exhibits a break either from I(0) to I(1) or vice versa. Sibbertsen and Kruse (2009) extended the test such that under the null hypothesis the time series is I(d) throughout, with d>1/2 and under the alternative a change from I(d1) to I(d2), where d1<1/2 and 1/2<d2<3/2, or vice versa has occured. While the test statistic remains the same, the critical values of the extended test change as they depend on the order of integration. Furthermore, the procedure by SK integrates the series if d is estimated to be smaller than 1/2. This allows to overcome the problem of the approach by LKT which is that is has a degenerated limiting distribution when the series is stationary. To determine the order of integration (the memory parameter d) the semiparametric estimator by Geweke and Porter-Hudak (1983) is used.

The critical values of the tests vary with sample size and d. If simu=0, the critical values provided are based on linear interpolation of the critical values simulated by Leybourne, Taylor, and Kim (2006) respectively the response curves by Sibbertsen and Kruse (2009). These are, however, only valid for tau=0.2 and m=0. In case that non-default values are chosen for tau or m, it is recommended to set simu=1 which means that critical values are simulated based on the given data using M replications. Caution, for a time series of length T=100 and M=10,000 replications this takes approximately thirty minutes with increasing duration for higher T or M. It should be noted, however, that M smaller than 10,000 make the results unreliable.


Returns a matrix that consists of test statistic and critical values for testing against a change from nonstationary to stationary, stationary to nonstationary, and against a change in an unknown direction.


Janis Becker


Leybourne, S., Kim, T., and Taylor, R. (2007): Cusum of squares-based tests for a change in persistence. Journal of Time Series Analysis, 28, pp. 408-433.

Sibbertsen, P. and Kruse, R. (2009): Testing for a break in persistence under long-range dependencies. Journal of Time Series Analysis, 30, pp. 263-285.



# generate dummy-data
series <- c(rnorm(200), cumsum(rnorm(200)))

# test for a break in persistence
cusum_test(series, trend="none", type="SK")

Example output

            90%       95%       99% Teststatistic
Lower 0.4036109 0.3079101 0.1838144    0.04164978
Upper 2.5088088 3.2998482 5.3169648    0.04164978

memochange documentation built on July 27, 2020, 1:09 a.m.