seqOpenEndCpMean | R Documentation |
Open-end nonparametric sequential test for change-point detection based on the retrospective CUSUM statistic. The observations need to be univariate but can be serially dependent. To carry out the test, two steps are required. The first step consists of computing a detector function. The second step consists of comparing the detector function to a suitable constant threshold function. Each of these steps corresponds to one of the functions in the usage section below. The current implementation is preliminary and not optimized for real-time monitoring (but could still be used for that). Details can be found in the third reference.
detOpenEndCpMean(x.learn, x, sigma = NULL, b = NULL,
weights = c("parzen", "bartlett"))
monOpenEndCpMean(det, statistic = c("t", "s", "r", "e", "cs"), eta = 0.001,
gamma = 0.45, alpha = 0.05, sigma = NULL, plot = TRUE)
x.learn |
a numeric vector representing the learning sample. |
x |
a numeric vector representing the observations collected after the beginning of the monitoring for a change in mean. |
sigma |
an estimate of the long-run variance of the time series of
which |
b |
strictly positive integer specifying the value of the
bandwidth for the estimation of the long-run variance if
|
weights |
a string specifying the kernel for creating the weights
used for the estimation of the long-run variance if |
det |
an object of class |
statistic |
a string specifying the statistic/detector to be used
for the monitoring; can be either |
eta |
a real parameter whose role is described in detail in the third reference. |
gamma |
a real parameter that can improve the power of the sequential test at the beginning of the monitoring; possible values are 0, 0.1, 0.25, 0.45, 0.65 and 0.85, but not for all statistics; see the third reference. |
alpha |
the value of the desired significance level for the sequential test. |
plot |
logical indicating whether the monitoring should be plotted. |
The testing procedure is described in detail in the third
reference. An alternative way of estimating the long-run variance is
to use the function lrvar()
of the package
sandwich and to pass it through the argument sigma
.
Both functions return lists whose components have explicit names. The
function monOpenEndCpMean()
in particular returns a list whose
components are
alarm |
a logical indicating whether the detector function has exceeded the threshold function. |
time.alarm |
an integer corresponding to the time at
which the detector function has exceeded the threshold function or
|
times.max |
a vector of times at which the successive detectors
|
time.change |
an integer giving the estimated time of change if
|
statistic |
the value of |
eta |
the value of |
gamma |
the value of |
alpha |
the value of |
sigma |
the value of |
detector |
the successive values of the chosen detector. |
threshold |
the value of the constant threshold for the chosen detector. |
A. Bücher and I. Kojadinovic (2016), A dependent multiplier bootstrap for the sequential empirical copula process under strong mixing, Bernoulli 22:2, pages 927-968, https://arxiv.org/abs/1306.3930.
J. Gösmann, T. Kley and H. Dette (2021), A new approach for open-end sequential change point monitoring, Journal of Time Series Analysis 42:1, pages 63-84, https://arxiv.org/abs/1906.03225.
M. Holmes and I. Kojadinovic (2021), Open-end nonparametric sequential change-point detection based on the retrospective CUSUM statistic, Electronic Journal of Statistics 15:1, pages 2288-2335, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/21-EJS1840")}.
D.N. Politis and H. White (2004), Automatic block-length selection for the dependent bootstrap, Econometric Reviews 23(1), pages 53-70.
See cpMean()
for the corresponding a posteriori
(offline) test and detOpenEndCpDist()
for the corresponding test for
changes in the distribution function.
## Not run:
## Example of open-end monitoring
m <- 100 # size of the learning sample
## The learning sample
set.seed(123)
x.learn <- rnorm(m)
## New observations with a change in mean
## to simulate monitoring for the period m+1, ..., n
n <- 5000
k <- 2500 ## the true change-point
x <- c(rnorm(k-m), rnorm(n-k, mean = 0.2))
## Step 1: Compute the detector
det <- detOpenEndCpMean(x.learn = x.learn, x = x)
## Step 2: Monitoring with the default detector
m1 <- monOpenEndCpMean(det)
str(m1)
## Monitoring with another detector
m2 <- monOpenEndCpMean(det, statistic = "s", gamma = 0.85)
str(m2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.