Learn R Programming

robcp (version 0.3.8)

scale_cusum: Tests for Scale Changes Based on Pairwise Differences

Description

Performs the CUSUM-based test on changes in the scale.

Usage

scale_cusum(x, version =  c("empVar", "MD", "GMD", "Qalpha"), method = "kernel",
            control = list(), alpha = 0.8, fpc = TRUE, tol,
            plot = FALSE, level = 0.05)

Value

A list of the class "htest" containing the following components:

statistic

return value of the function scale_stat.

p.value

p-value (numeric).

alternative

alternative hypothesis (character string).

method

name of the performed test (character string).

cp.location

index of the estimated change point location (integer).

data.name

name of the data (character string).

Plus if method = "kernel":

lrv

list containing the compontents method, param and value.

else if method = "bootstrap":

bootstrap

list containing the compontents param (= block length) and crit.value.

Arguments

x

time series (numeric or ts vector).

version

variance estimation method (see scale_stat).

method

method for estimating the long run variance.

control

a list of control parameters.

alpha

quantile of the distribution function of all absolute pairwise differences used in version = "Qalpha".

fpc

finite population correction (boolean).

tol

tolerance for the computation of the p-value (numeric). Default for kernel-based long run variance estimation: 1e-8. Default for bootstrap: 1e-3.

plot

should the test statistic be plotted (cf. plot.cpStat)? Boolean.

level

significance level of the test (numeric between 0 and 1).

Author

Sheila Görz

Details

The function performs a CUSUM-type test on changes in the scale. Formally, the hypothesis pair is $$H_0: \sigma^2_2 = ... = \sigma_n^2$$ $$vs.$$ $$H_1: \exists k \in \{2, ..., n-1\}: \sigma^2_k \neq \sigma^2_{k+1}$$ where \(\sigma^2_t = Var(X_t)\) and \(n\) is the length of the time series. \(k\) is called a 'change point'. The hypotheses do not include \(\sigma^2_1\) since then the variance of one single observation would need to be estimated.

The test statistic is computed using scale_stat and in the case of method = "kernel" asymptotically follows a Kolmogorov distribution. To derive the p-value, the function pKSdist is used.

If method = "bootstrap", a dependent block bootstrap with parameters \(B = 1/\)tol and \(l =\) control$l is performed in order to derive the p-value of the test. First, select a boostrap sample \(x_1^*, ..., x_{kl}^*\), \(k = \lfloor n/l \rfloor\), the following way: Uniformly draw a random iid sample \(J_1, ..., J_k\) from \(\{1, ..., n-l+1\}\) and concatenate the blocks \(x_{J_i}, ..., x_{J_i + l-1}\) for \(i = 1, ..., k\). Then apply the test statistic \(\hat{T}_s\) to the bootstrap sample. Repeat the procedure \(B\) times. The p-value is can be obtained as the proportion of the bootstrapped test statistics which is larger than the test statistic on the full sample.

References

Gerstenberger, C., Vogel, D., and Wendler, M. (2020). Tests for scale changes based on pairwise differences. Journal of the American Statistical Association, 115(531), 1336-1348.

Dürre, A. (2022+). "Finite sample correction for cusum tests", unpublished manuscript

See Also

scale_stat, lrv, pKSdist, Qalpha

Examples

Run this code
x <- arima.sim(list(ar = 0.5), 100)

# under H_0:
scale_cusum(x)
scale_cusum(x, "MD")

# under the alternative:
x[51:100] <- x[51:100] * 3
scale_cusum(x)
scale_cusum(x, "MD")

Run the code above in your browser using DataLab