seqOpenEndCpMean  R Documentation 
Openend nonparametric sequential test for changepoint 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 realtime 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 longrun variance of the time series of
which 
b 
strictly positive integer specifying the value of the
bandwidth for the estimation of the longrun variance if

weights 
a string specifying the kernel for creating the weights
used for the estimation of the longrun 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 longrun 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 927968, https://arxiv.org/abs/1306.3930.
J. Gösmann, T. Kley and H. Dette (2021), A new approach for openend sequential change point monitoring, Journal of Time Series Analysis 42:1, pages 6384, https://arxiv.org/abs/1906.03225.
M. Holmes and I. Kojadinovic (2021), Openend nonparametric sequential changepoint detection based on the retrospective CUSUM statistic, Electronic Journal of Statistics 15:1, pages 22882335, doi: 10.1214/21EJS1840.
D.N. Politis and H. White (2004), Automatic blocklength selection for the dependent bootstrap, Econometric Reviews 23(1), pages 5370.
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 openend 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 changepoint x < c(rnorm(km), rnorm(nk, 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.