scale_cusum | R Documentation |
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)
x |
time series (numeric or ts vector). |
version |
variance estimation method (see |
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 |
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. |
level |
significance level of the test (numeric between 0 and 1). |
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.
A list of the class "htest" containing the following components:
statistic |
return value of the function |
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 |
else if method = "bootstrap"
:
bootstrap |
list containing the compontents |
Sheila Görz
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.