This function performs a sup Wald test for a change-in-mean that is robust under long memory. In contrast to a standard sup Wald test it applies a self-normalization approach to estimate the long-run variance. The function returns the test statistic as well as critical values.
snsupwald(x, d, tau = 0.15)
the univariate numeric vector to be investigated. Missing values are not allowed.
integer that specifies the long-memory parameter.
integer that defines the search area, which is
Note that the critical values are generated for
Returns a numeric vector containing the test statistic and the corresponding critical values of the test.
Wenger, K. and Leschinski, C. and Sibbertsen, P. (2018): Change-in-mean tests in long-memory time series: a review of recent developments. AStA Advances in Statistical Analysis, 103:2, pp. 237-256.
Shao, X. (2011): A simple test of changes in mean in the possible presence of long-range dependence. Journal of Time Series Analysis, 32, pp. 598-606.
Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# set model parameters T <- 500 d <- 0.2 set.seed(410) # generate a fractionally integrated (long-memory) time series tseries <- fracdiff::fracdiff.sim(n=T, d=d)$series # generate a fractionally integrated (long-memory) time series # with a change in mean in the middle of the series changep <- c(rep(0,T/2), rep(1,T/2)) tseries2 <- tseries+changep # estimate the long-memory parameter of both series via local # Whittle approach. The bandwidth to estimate d is chosen # as T^0.65, which is usual in literature d_est <- LongMemoryTS::local.W(tseries, m=floor(1+T^0.65))$d d_est2 <- LongMemoryTS::local.W(tseries2, m=floor(1+T^0.65))$d # perform the test on both time series snsupwald(tseries, d=d_est) snsupwald(tseries2, d=d_est2) # For the series with no change in mean the test does not reject the # null hypothesis of a constant mean across time at any reasonable # significance level. # For the series with a change in mean the test rejects the null hypothesis # at a 1% significance level.
90% 95% 99% Teststatistic 31.984 37.412 49.325 18.607 90% 95% 99% Teststatistic 39.338 46.646 61.826 55.678
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.