Performs the CUSUM-based test on changes in the scale.
scale_cusum(x, version = c("empVar", "MD", "GMD", "Qalpha"), method = "kernel",
control = list(), alpha = 0.8, fpc = TRUE, tol,
plot = FALSE, level = 0.05)
A list of the class "htest" containing the following components:
return value of the function scale_stat
.
p-value (numeric).
alternative hypothesis (character string).
name of the performed test (character string).
index of the estimated change point location (integer).
name of the data (character string).
Plus if method = "kernel"
:
list containing the compontents method
, param
and value
.
else if method = "bootstrap"
:
list containing the compontents param
(= block length) and crit.value
.
time series (numeric or ts vector).
variance estimation method (see scale_stat
).
method for estimating the long run variance.
a list of control parameters.
quantile of the distribution function of all absolute pairwise differences used in version = "Qalpha"
.
finite population correction (boolean).
tolerance for the computation of the p-value (numeric). Default for kernel-based long run variance estimation: 1e-8. Default for bootstrap: 1e-3.
should the test statistic be plotted (cf. plot.cpStat
)? Boolean.
significance level of the test (numeric between 0 and 1).
Sheila Görz
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.
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
scale_stat
, lrv
, pKSdist
, Qalpha
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