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}{\sqrt{n} \sigma}\left|\sum_{i = 1}^{k} x_i - (k / n) \sum_{i = 1}^n x_i\right|,
where \sigma
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 (\rho
) is computed. Then the default bandwidth follows as
b_n = \max\left\{\left\lceil n^{0.45} \left( \frac{2\rho}{1 - \rho^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}\left(\sum_{i = 1}^{k} X_i - \frac{k}{n} \sum_{i = 1}^{n} X_i\right)^T \Sigma^{-1} \left(\sum_{i = 1}^{k} X_i - \frac{k}{n} \sum_{i = 1}^{n} X_i\right),
where X_i
denotes the i-th row of x and \Sigma^{-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.