CUSUM | R Documentation |
Computes the test statistic for the CUSUM change point test.
CUSUM(x, method = "kernel", control = list(), inverse = "Cholesky", ...)
x |
vector or matrix with each column representing a time series (numeric). |
method |
method of long run variance estimation. Options are |
control |
a list of control parameters for the estimation of the long run variance (cf. |
inverse |
character string specifying the method of inversion. Options are "Cholesky" for inverting over |
... |
further arguments passed to the inverse-computing functions. |
Let n be the length of the time series x = (x_1, ..., x_n).
In case of a univariate time series the test statistic can be written as
\max_{k = 1, ..., n}\frac{1}{√{n} σ}≤ft|∑_{i = 1}^{k} x_i - (k / n) ∑_{i = 1}^n x_i\right|,
where σ is the square root of lrv
.
Default method is "kernel"
and the default kernel function is "TH"
. If no bandwidth value is supplied, first the time series x is corrected for the estimated change point and Spearman's autocorrelation to lag 1 (ρ) is computed. Then the default bandwidth follows as
b_n = \max≤ft\{≤ft\lceil n^{0.45} ≤ft( \frac{2ρ}{1 - ρ^2} \right)^{0.4} \right\rceil, 1 \right\}.
In case of a multivariate time series the test statistic follows as
\max_{k = 1, ..., n}\frac{1}{n}≤ft(∑_{i = 1}^{k} X_i - \frac{k}{n} ∑_{i = 1}^{n} X_i\right)^T Σ^{-1} ≤ft(∑_{i = 1}^{k} X_i - \frac{k}{n} ∑_{i = 1}^{n} X_i\right),
where X_i denotes the i-th row of x and Σ^{-1} is the inverse of lrv
.
Test statistic (numeric value) with the following attributes:
cp-location |
indicating at which index a change point is most likely. |
teststat |
test process (before taking the maximum). |
lrv-estimation |
long run variance estimation method. |
sigma |
estimated long run variance. |
param |
parameter used for the lrv estimation. |
kFun |
kernel function used for the lrv estimation. |
Is an S3 object of the class "cpStat".
Sheila Görz
psi_cumsum
,
psi
# time series with a location change at t = 20 ts <- c(rnorm(20, 0), rnorm(20, 2)) # Huberized CUSUM change point test statistic CUSUM(psi(ts))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.