Package 'memochange'

Title: Testing for Structural Breaks under Long Memory and Testing for Changes in Persistence
Description: Test procedures and break point estimators for persistent processes that exhibit structural breaks in mean or in persistence. On the one hand the package contains the most popular approaches for testing whether a time series exhibits a break in persistence from I(0) to I(1) or vice versa, such as those of Busetti and Taylor (2004) and Leybourne, Kim, and Taylor (2007). The approach by Martins and Rodrigues (2014), which allows to detect changes from I(d1) to I(d2) with d1 and d2 being non-integers, is included as well. In case the tests reject the null of constant persistence, various breakpoint estimators are available to detect the point of the break as well as the order of integration in the two regimes. On the other hand the package contains the most popular approaches to test for a change-in-mean of a long-memory time series, which were recently reviewed by Wenger, Leschinski, and Sibbertsen (2018). These include memory robust versions of the CUSUM, sup-Wald, and Wilcoxon type tests. The tests either utilize consistent estimates of the long-run variance or a self normalization approach in their test statistics. Betken (2016) <doi:10.1111/jtsa.12187> Busetti and Taylor (2004) <doi:10.1016/j.jeconom.2003.10.028> Dehling, Rooch and Taqqu (2012) <doi:10.1111/j.1467-9469.2012.00799.x> Harvey, Leybourne and Taylor (2006) <doi:10.1016/j.jeconom.2005.07.002> Horvath and Kokoszka (1997) <doi:10.1016/S0378-3758(96)00208-X> Hualde and Iacone (2017) <doi:10.1016/j.econlet.2016.10.014> Iacone, Leybourne and Taylor (2014) <doi:10.1111/jtsa.12049> Leybourne, Kim, Smith, and Newbold (2003) <doi:10.1111/1368-423X.t01-1-00110> Leybourne and Taylor (2004) <doi:10.1016/j.econlet.2003.12.015> Leybourne, Kim, and Taylor (2007): <doi:10.1111/j.1467-9892.2006.00517.x> Martins and Rodrigues (2014) <doi:10.1016/j.csda.2012.07.021> Shao (2011) <doi:10.1111/j.1467-9892.2010.00717.x> Sibbertsen and Kruse (2009) <doi:10.1111/j.1467-9892.2009.00611.x> Wang (2008) <doi:10.1080/00949650701216604> Wenger, Leschinski and Sibbertsen (2018) <doi:10.1016/j.econlet.2017.12.007>.
Authors: Janis Becker [aut], Kai Wenger [aut, cre]
Maintainer: Kai Wenger <[email protected]>
License: GPL-2
Version: 1.1.1
Built: 2025-02-01 06:15:11 UTC
Source: https://github.com/kaiwenger/memochange

Help Index


Breakpoint estimators for a change in persistence

Description

This function estimates the location where the investigated time series exhibits a break in persistence. It requires knowledge of the direction of the break, i.e. an increase or decrease in persistence. This needs to be determined beforehand using one of the various persistence change tests provided in this package.

Usage

BP_estim(x, trend = c("none", "linear"), tau = 0.2, type = c("BT",
  "LKT", "LKSN", "MR"), direction = c("01", "10"), d_estim = c("ELW",
  "GPH"), d_bw = 0.7, m = 0, serial = c(FALSE, TRUE))

Arguments

x

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

trend

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

tau

the function searches 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 type="BT" and T*tau<=2+ as.numeric(trend=="linear"), type="LT" and T*tau<=2+ as.numeric(trend=="linear") + (m>3)*(m-3), type="LKSN" and T*tau<=10, or type="MR" and T*tau<=2+(p>1)*pthe break point cannot be found.

type

which type of break point estimator should be used, "LKSN" for the estimator by Leybourne, Kim, Smith, and Newbold (2003), "BT" for the estimator by Busetti and Taylor (2004), "LKT" for the estimator by Leybourne, Kim, and Taylor (2006), and MR for the estimator by Martins and Rodrigues (2014). See details.

direction

direction of the change in persistence, "01" implies an increase in persistence over time and "10" a decrease. See details.

d_estim

which estimator should be used to determine the order of integration in the two regimes, "GPH" corresponds to the estimator by Geweke and Porter-Hudak (1983) and "ELW" corresponds to the exact local Whittle estimator by Shimotsu and Phillips (2005).

d_bw

bandwidth used for estimating the order of integration d. Default is d_bw=0.7. Note that the estimation of the memory parameter can only be performed for 0<d_bw<=1 and it is even recommended to choose 0.5<=d_bw<=0.8 as otherwise the estimators might be inconsistent.")

m

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

serial

boolean, indicating whether to account for serial correlation of the errors when considering the MR estimator. Default is serial=FALSE implying no correction for serial correlation.

Details

The estimators BT and LKSN are only consistent for changes from I(0) to I(1) or vice versa, the LKT estimator is consistent for changes from stationary to nonstationary memory or vice versa (cf. also Sibbertsen and Kruse (2009)), and the MR estimator is consistent for changes in d in general.

Value

Returns a list that contains break point, estimate of the order of integration in the two regimes (the memory parameter d) and standard deviation of this estimate.

Author(s)

Janis Becker

References

Leybourne, S., Kim, T., Smith, V., and Newbold, P. (2003): Tests for a change in persistence against the null of difference-stationarity. Econometrics Journal, 6, pp. 291-311.

Busetti, F. and Taylor, R. (2004): Tests of stationarity against a change in persistence. Journal of Econometrics, 123, pp. 33-66.

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.

Martins, L.. and Rodrigues, P. (2014): Testing for persistence change in fractionally integrated models: An application to world inflation rates Cusum of squares-based tests for a change in persistence. Computational Statistics and Data Analysis, 76, pp. 502-522.

See Also

cusum_test, LKSN_test, MR_test, ratio_test.

Examples

set.seed(410)

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

# estimate the break point
BP_estim(series, trend="none", type="BT", direction="01", d_estim="ELW")

Simple test for change-in-mean under long memory

Description

This function performs a CUSUM test on a change-in-mean that is robust under long memory. It is based on the fractionally differenced series where the long-memory parameter is estimated by a consistent estimator. The function returns the test statistic as well as the p-value of the test.

Usage

CUSUM_simple(x, d)

Arguments

x

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

d

integer that specifies the long-memory parameter.

Value

Returns a numeric vector containing the test statistic and the p-value of the test.

Author(s)

Kai Wenger

References

Wenger, K. and Leschinski, C. and Sibbertsen, P. (2018): A simple test on structural change in long-memory time series. Economics Letters, 136, pp. 90-94.

See Also

CUSUMLM, CUSUMfixed

Examples

# set model parameters
T        <- 500
d        <- 0.2

set.seed(410)

# generate a fractionally integrated (long-memory) time series without a change in mean
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
CUSUM_simple(tseries, d_est)
CUSUM_simple(tseries2, 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 5% significance level.

Cusum-type test against a change in persistence

Description

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.

Usage

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

Arguments

x

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

trend

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

tau

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.

type

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.

m

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

simu

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.

M

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

Details

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.

Value

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.

Author(s)

Janis Becker

References

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.

Examples

set.seed(410)

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

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

Self-normalized CUSUM tests for structural change under long memory.

Description

This function performs a family of CUSUM tests for a change-in-mean that are robust under long memory. They apply non-parametric kernel-based fixed-b and fixed-m long-run variance estimators in the denominator of the test statistics. The function returns the test statistic as well as critical values.

Usage

CUSUMfixed(x, d, procedure, bandw, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

procedure

string that specifies whether the CUSUM fixed-b or fixed-m type A or type B tests are used. It can be chosen between "CUSUMfixedb_typeA", "CUSUMfixedb_typeB", "CUSUMfixedm_typeA", and "CUSUMfixedm_typeB" (see Wenger, Leschinski (2019) for details).

bandw

integer that determines the bandwidth used for estimation of the long-run variance. For the fixed-b tests b=[0.05,0.1,0.2,0.3,...,0.9,1], for the fixed-m tests m=[1,2,3,4,10,25,50,100,150,200]. Recommended bandwidth by Wenger, Leschinski (2019) are b=0.1 and m=10.

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15 using the Bartlett kernel for the fixed-b tests or averaging the first m periodogram ordinates (which corresponds to the Daniell kernel) for the fixed-m tests.

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

Wenger, K. and Leschinski, C. (2019): Change-in-mean tests in long-memory time series: a review of recent developments. AStA Advances in Statistical Analysis, 103:2, pp. 237-256.

Hualde, J. and Iacone, F. (2017): Fixed bandwidth asymptotics for the studentized mean of fractionally integrated processes. Economics Letters, 150, pp. 39-43.

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

See Also

CUSUMLM, CUSUM_simple, fixbsupw

Examples

# 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 different types of the test on both time series
CUSUMfixed(tseries, d=d_est, procedure="CUSUMfixedb_typeA", bandw=0.1)
CUSUMfixed(tseries, d=d_est, procedure="CUSUMfixedb_typeB", bandw=0.1)
CUSUMfixed(tseries, d=d_est, procedure="CUSUMfixedm_typeA", bandw=10)
CUSUMfixed(tseries, d=d_est, procedure="CUSUMfixedm_typeB", bandw=10)

CUSUMfixed(tseries2, d=d_est2, procedure="CUSUMfixedb_typeA", bandw=0.1)
CUSUMfixed(tseries2, d=d_est2, procedure="CUSUMfixedb_typeB", bandw=0.1)
CUSUMfixed(tseries2, d=d_est2, procedure="CUSUMfixedm_typeA", bandw=10)
CUSUMfixed(tseries2, d=d_est2, procedure="CUSUMfixedm_typeB", bandw=10)
# For the series with no change in mean all tests do not reject 
# the null hypothesis of a constant mean across time at 
# any reasonable significance level.
# For the series with a change in mean all tests reject the 
# null hypothesis at a 1% significance level.

CUSUM long memory test for a single change in the mean of a long-memory time series.

Description

This function performs a modified CUSUM test for a change-in-mean that is robust under long memory. It replaces the standardization as well as the long-run variance estimator compared to the standard CUSUM test. The function returns the test statistic as well as critical values.

Usage

CUSUMLM(x, d, delta, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

delta

integer that determines the bandwidth that is used to estimate the constant G that approximates the short run dynamics of the time series at the origin. The same bandwidth should be used that is applied to estimate d before. See Wenger, Leschinski, Sibbertsen (2018) for details.

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15.

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

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.

Wang, L. (2008): Change-in-mean problem for long memory time series models with applications. Journal of Statistical Computation and Simulation, 78:7, pp. 653-668.

Horvath, L. and Kokoszka, P. (1997): The effect of long-range dependence on change-point estimators. Journal of Statistical Planung and Inference, 64, pp. 57-81.

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

See Also

CUSUMfixed, CUSUM_simple

Examples

# 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
CUSUMLM(tseries, delta=0.65, d=d_est)
CUSUMLM(tseries2, delta=0.65, 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.

Fixed-b sup Wald test for a single change in the mean of a long-memory time series.

Description

This function performs a sup-Wald test on a change-in-mean, which is standardized by a non-parametric kernel-based long-run variance estimator. Therefore, the test is robust under long-memory. The function returns the test statistic as well as critical values.

Usage

fixbsupw(x, d, bandw = 0.1, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

bandw

integer that determines the bandwidth parameter for the long-run variance estimator. It can take values in the range bandw=[0.05,0.1,0.2]. Default is bandw=0.1, which is suggested by Iacone, Leybourne and Taylor (2014).

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15 using the Bartlett kernel.

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

Iacone, F. and Leybourne, S. J. and Taylor, R. A. M. (2014): A fixed-b Test for a Break in Level at an unknown Time under Fractional Integration. Journal of Time Series Analysis, 35, pp. 40-54.

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

See Also

CUSUMfixed, snsupwald

Examples

# 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
fixbsupw(tseries, d=d_est)
fixbsupw(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.

Locally best invariant test against a change in persistence

Description

This function performs the locally best invariant test against a change in persistence as suggested by Busetti and Taylor (2004). Under the null hypothesis the time series is I(0) throughout and under the alternative a change from either I(1) to I(0) or I(0) to I(1) has occured.

Usage

LBI_test(x, trend = c("none", "linear"), tau = 0.2,
  statistic = c("mean", "max", "exp"), simu = 0, M = 10000)

Arguments

x

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

trend

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

tau

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") the test statistic cannot be calculated.

statistic

which type of test statistic should be used, "mean" corresponds to Hansen's (1991) mean score, "max" to Andrews' (1993) maximum statistic, and "exp" to Andrews and Ploberger's (1994) mean-exponential statistic.

simu

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

M

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

Details

The critical values of the tests vary with the sample size. If simu=0, the critical values provided are based on linear interpolation of the critical values simulated by Busetti and Taylor (2004). These are, however, only valid for tau=0.2. In case that another value is chosen for tau, it is recommended to set simu=1 which means that critical values are simulated based on the given data using M replications. For a time series of length T=100 and M=10,000 replications this takes approximately five minutes with increasing duration for higher T or M. It should be noted, however, that M smaller than 10,000 make the results unreliable.

Value

Returns a matrix that consists of test statistic and critical values (corresponding to alpha=0.1,0.05,0.01) for testing against a change from I(1) to I(0), I(0) to I(1), and against a change in an unknown direction.

Author(s)

Janis Becker

References

Busetti, F. and Taylor, R. (2004): Tests of stationarity against a change in persistence. Journal of Econometrics, 123, pp. 33-66.

See Also

cusum_test, LKSN_test, MR_test, ratio_test.

Examples

set.seed(410)

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

# test for a break in persistence
LBI_test(series, trend="none", statistic="mean")

DF-type test against a change in persistence

Description

This function performs the DF-type test against a change in persistence as suggested by Leybourne, Kim, Smith, and Newbold (2003). Under the null hypothesis the time series is I(1) throughout and under the alternative a change from either I(1) to I(0) or I(0) to I(1) has occured.

Usage

LKSN_test(x, trend = c("none", "linear"), tau = 0.2, lmax = 0,
  simu = 0, M = 10000)

Arguments

x

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

trend

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

tau

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<11 the test statistic cannot be calculated.

lmax

Maximum number of lagged differences to be included in the test regression. Default is lmax=0. Note that small sample critical values might differ for lmax>0 so that simulation is recommended in this case.

simu

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

M

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

Details

The critical values of the tests vary with the sample size. If simu=0, the critical values provided are based on linear interpolation of the critical values simulated by Leybourne, Kim, Smith, and Newbold (2003). These are, however, only valid for tau=0.2 and lmax=0. In case that non-default values are chosen for tau or lmax, 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.

Value

Returns a matrix that consists of test statistic and critical values (corresponding to alpha=0.1,0.05) for testing against a change from I(1) to I(0), I(0) to I(1), and against a change in an unknown direction.

Author(s)

Janis Becker

References

Leybourne, S., Kim, T., Smith, V., and Newbold, P. (2003): Tests for a change in persistence against the null of difference-stationarity. Econometrics Journal, 6, pp. 291-311.

See Also

cusum_test, LBI_test, MR_test, ratio_test.

Examples

set.seed(410)

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

# test for a break in persistence
LKSN_test(series, trend="none")

memochange: Testing for Structural Breaks under Long Memory and Testing for Changes in Persistence

Description

Test procedures and break point estimators for persistent processes that exhibit structural breaks in mean or in persistence.

On the one hand, the package contains the most popular approaches for testing whether a time series exhibits a break in persistence from I(0) to I(1) or vice versa, such as those of Busetti and Taylor (2004) and Leybourne, Kim, and Taylor (2007). The approach by Martins and Rodrigues (2014), which allows to detect changes from I(d1) to I(d2) with d1 and d2 being non-integers, is included as well.
In case the tests reject the null of constant persistence, various breakpoint estimators are available to detect the point of the break as well as the order of integration in the two regimes.

On the other hand, the package contains the most popular approaches to test for a change in mean in a long-memory time series, which were recently reviewed by Wenger, Leschinski, and Sibbertsen (2018). These include memory robust versions of the CUSUM, sup-Wald, and Wilcoxon type tests. The tests either utilize consistent estimates of the long-run variance or a self normalization approach in their test statistics.

Details

For details see the readme and vignettes in the corresponding GitHub repository (https://github.com/KaiWenger/memochange).

Author(s)

Kai Wenger <[email protected]>, Janis Becker

References

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

Betken, A. (2016): Testing for change-points in long-range dependent time series by means of a self-normalized wilcoxon test. Journal of Time Series Analysis, 37, pp. 785-908.

Busetti, F. and Taylor, R. (2004): Tests of stationarity against a change in persistence. Journal of Econometrics, 123, pp. 33-66.

Dehling, H. and Rooch, A. and Taqqu, M. S. (2012): Non-Parametric Change-Point Tests for Long-Range Dependent Data. Scandinavian Journal of Statistics, 40, pp. 153-173.

Harvey, D., Leybourne, S. and Taylor, R. (2006): Modified tests for a change in persistence. Journal of Econometrics, 134, pp. 441-469.

Horvath, L. and Kokoszka, P. (1997): The effect of long-range dependence on change-point estimators. Journal of Statistical Planung and Inference, 64, pp. 57-81.

Hualde, J. and Iacone, F. (2017): Fixed bandwidth asymptotics for the studentized mean of fractionally integrated processes. Economics Letters, 150, pp. 39-43.

Iacone, F. and Leybourne, S. J. and Taylor, R. A. M. (2014): A fixed-b Test for a Break in Level at an unknown Time under Fractional Integration. Journal of Time Series Analysis, 35, pp. 40-54.

Leybourne, S., Kim, T., Smith, V., and Newbold, P. (2003): Tests for a change in persistence against the null of difference-stationarity. Econometrics Journal, 6, pp. 291-311.

Leybourne, S. and Taylor, R. (2004): On tests for changes in persistence. Economics letters, 84, pp. 107-115.

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.

Martins, L.. and Rodrigues, P. (2014): Testing for persistence change in fractionally integrated models: An application to world inflation rates Cusum of squares-based tests for a change in persistence. Computational Statistics and Data Analysis, 76, pp. 502-522.

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.

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.

Wang, L. (2008): Change-in-mean problem for long memory time series models with applications. Journal of Statistical Computation and Simulation, 78:7, pp. 653-668.

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.

Wenger, K. and Leschinski, C. and Sibbertsen, P. (2018): A simple test on structural change in long-memory time series. Economics Letters, 136, pp. 90-94.

See Also

BP_estim, CUSUM_simple, cusum_test, CUSUMfixed, CUSUMLM, fixbsupw, LBI_test, LKSN_test, MR_test, pb_sim, ratio_test, snsupwald, snwilcoxon, wilcoxonLM


LM test against a change in persistence

Description

This function performs a LM-type test for a change in persistence as suggested by Martins and Rodrigues (2014). Under the null hypothesis the memory parameter d is constant over the sample. Under the alternative an increase or a decrease of the memory parameter has occured over time.

Usage

MR_test(x, trend = c("none", "linear"), tau = 0.2,
  statistic = c("squared", "standard"), simu = 0, M = 10000,
  serial = c(FALSE, TRUE))

Arguments

x

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

trend

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

tau

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<=2 the test statistic cannot be calculated.

statistic

which type of test statistic should be used, "squared" for the squared t-statistic and "standard" for the standard t-test. Default is statistic="squared".

simu

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

M

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

serial

boolean, indicating whether to account for serial correlation of the errors. Default is serial=FALSE implying no correction for serial correlation.

Details

The critical values of the tests vary with sample size and memory parameter d. If simu=0, the critical values provided are based on linear interpolation of the critical values simulated by Martins and Rodrigues (2014). These are, however, only valid for tau=0.2 and serial=FALSE. In case that non-default values are chosen for tau or serial, 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=750 and M=10,000 replications this takes approximately twelve hours with increasing duration for higher T or M. It should be noted, however, that M smaller than 10,000 make the results unreliable.

Value

Returns a matrix that consists of test statistic and critical values (corresponding to alpha=0.1,0.05,0.01) for testing against an increase in memory, against a decrease in memory, and against a change in an unknown direction.

Author(s)

Janis Becker

References

Martins, L.. and Rodrigues, P. (2014): Testing for persistence change in fractionally integrated models: An application to world inflation rates. Computational Statistics and Data Analysis, 76, pp. 502-522.

See Also

cusum_test, LBI_test, LKSN_test, ratio_test.

Examples

set.seed(410)

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

# test for a break in persistence
MR_test(series, trend="none", statistic="squared")

Simulates persistence-break process

Description

This function simulates a fractional white noise process that exhibits a break in persistence using FI.sim from the LongMemoryTS package. In the first part of the series the noise is integrated with order d_1 and in the second part with order d_2.

Usage

pb_sim(T, tau, trend = c("none", "linear"), tp = 0, d1, d2, mean = 0,
  var = 1)

Arguments

T

length of the time series.

tau

break fraction, T*tau yields the break point. It needs to hold that 0<tau<1.

trend

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

tp

trend parameter, t*tp yields the contribution of the trend component if trend="linear".

d1

order of integration of the first part of the series.

d2

order of integration of the second part of the series.

mean

mean of the series. Default is mean=0.

var

variance of the innovations. Default is var=1

Value

Returns a vector containing the simulated time series.

Author(s)

Janis Becker

Examples

set.seed(410)

# generate persistence-break time series
series <- pb_sim(500, 0.5, "none", d1=0.2, d2=0.8, mean=0, var=1)

# plot generated series
stats::ts.plot(series)

Ratio-based test against a change in persistence

Description

This function performs a ratio-based test against a change in persistence. Under the null hypothesis the time series is I(0) throughout and under the alternative a change from either I(1) to I(0) or I(0) to I(1) has occured.

Usage

ratio_test(x, trend = c("none", "linear"), tau = 0.2,
  statistic = c("mean", "max", "exp"), type = c("BT", "LT", "HLT",
  "HLTmin"), m = 0, z = 9, simu = 0, M = 10000)

Arguments

x

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

trend

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

tau

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 type="BT" or type="HLT" and T*tau<= 1 + as.numeric(trend=="linear"), type="LT" and T*tau<=1+ as.numeric(trend=="linear") + (m>3)*(m-3), or type="HLT" and T*tau<=(z+1) the test statistic cannot be calculated.

statistic

which type of test statistic should be used, "mean" corresponds to Hansen's (1991) mean score, "max" to Andrews' (1993) maximum statistic, and "exp" to Andrews and Ploberger's (1994) mean-exponential statistic

type

which type of ratio test should be performed, "BT" for the standard ratio test by Busetti and Taylor (2004), "LT" for the modified ratio test by Leybourne and Taylor (2004), and "HLT"" respectively "HLTmin" are the modified tests by Harvey, Leybourne, and Taylor (2006). See details.

m

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

z

Number of polynomials used if "HLT" or "HLTmin" are considered. Default is z=9.

simu

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.

M

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

Details

Busetti and Taylor (2004) (BT) introduced a test that is able to identify when time series exhibit changes in persistence. Under the null hypothesis, the series is constant I(0), i.e. stationary. Under the alternative the series exhibits a break either from I(0) to I(1) or I(1) to I(0). As the test is oversized for weakly dependent time series, Leybourne and Taylor (2004) (LT) standardized the test statistic by an estimate of the long run variance using m lags. Another problem is that constant I(1) processes are neither covered under the null nor the alternative. Here, the test often rejects the null although no change in persistence occured. Harvey, Leybourne, and Taylor (2006) (HLT) introduced a modification where they multiply the test statistic by a unit root test. This allows the test statistic to have the same critical values under both constant I(0) and constant I(1). It should be noted, however, that only the critical values are identical, the distribution is highly irregular.

The critical values of the tests vary with the sample size. If simu=0, the critical values provided are based on linear interpolation of the critical values simulated by Harvey, Leybourne, and Taylor (2006). These are, however, only valid for tau=0.2, m=0, and z=9. In case that non-default values are chosen for tau, m, or z, 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 fifteen minutes with increasing duration for higher T or M. It should be noted, however, that M smaller than 10,000 make the results unreliable.

Value

Returns a matrix that consists of test statistic and critical values (corresponding to alpha=0.1,0.05,0.01) for testing against a change from I(1) to I(0), I(0) to I(1), and against a change in an unknown direction.

Author(s)

Janis Becker

References

Busetti, F. and Taylor, R. (2004): Tests of stationarity against a change in persistence. Journal of Econometrics, 123, pp. 33-66.

Leybourne, S. and Taylor, R. (2004): On tests for changes in persistence. Economics letters, 84, pp. 107-115.

Harvey, D., Leybourne, S. and Taylor, R. (2006): Modified tests for a change in persistence. Journal of Econometrics, 134, pp. 441-469.

See Also

cusum_test, LBI_test, LKSN_test, MR_test.

Examples

set.seed(410)

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

# test for a break in persistence
ratio_test(series)

Self-normalized sup Wald test for a single change in the mean of a long-memory time series.

Description

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.

Usage

snsupwald(x, d, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15.

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

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.

See Also

fixbsupw, snwilcoxon

Examples

# 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.

Self-normalized Wilcoxon test for a single change in the mean of a long-memory time series.

Description

This function performs a Wilcoxon test for a change-in-mean that is robust under long memory. In contrast to a standard Wilcoxon test it applies a self-normalization approach to estimate the long-run variance. The function returns the test statistic as well as critical values.

Usage

snwilcoxon(x, d, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15. Furthermore, it is assumed that we have a 1st-order Hermite process. For details see Betken (2016).

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

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.

Betken, A. (2016): Testing for change-points in long-range dependent time series by means of a self-normalized wilcoxon test. Journal of Time Series Analysis, 37, pp. 785-908.

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

See Also

wilcoxonLM, snsupwald

Examples

# 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
snwilcoxon(tseries, d=d_est)
snwilcoxon(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.

Wilcoxon long memory test for a single change in the mean of a long-memory time series.

Description

This function performs a Wilcoxon type test for a change-in-mean that is robust under long memory. It applies a consistent estimator of the long-run variance under long memory and uses a different normalization compared to a standard Wilcoxon test. The function returns the test statistic as well as critical values.

Usage

wilcoxonLM(x, d, tau = 0.15)

Arguments

x

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

d

integer that specifies the long-memory parameter.

tau

integer that defines the search area, which is [tau,1-tau]. Default is tau=0.15 as suggested by Andrews (1993).

Details

Note that the critical values are generated for tau=0.15.

Value

Returns a numeric vector containing the test statistic and the corresponding critical values of the test.

Author(s)

Kai Wenger

References

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.

Dehling, H. and Rooch, A. and Taqqu, M. S. (2012): Non-Parametric Change-Point Tests for Long-Range Dependent Data. Scandinavian Journal of Statistics, 40, pp. 153-173.

Andrews, D. W. K. (1993): Tests for Parameter Instability and Structural Change With Unknown Change Point. Econometrica, 61, pp. 821-856.

See Also

snwilcoxon

Examples

# 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
wilcoxonLM(tseries, d=d_est)
wilcoxonLM(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 5% significance level.