Description Usage Arguments Details Value Note References See Also Examples
Closedend nonparametric sequential test for changepoint detection based on the (multivariate) empirical distribution function. The observations can be continuous univariate or multivariate, and serially independent or dependent (strongly mixing). To carry out the test, four steps are required. The first step consists of simulating under the null many trajectories of the detector function. The second step consists of estimating a piecewise constant threshold function from these trajectories. The third step consists of computing the detector function from the data to be monitored. The fourth and last step consists of comparing the detector function with the estimated 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). If the observations to be monitored are univariate and can be assumed serially independent, the simulation of the trajectories of the detector functions can be carried out using Monte Carlo simulation. In all other cases, the test relies on a dependent multiplier bootstrap. Details can be found in the second reference.
1 2 3 4 5 6 7 8 9 10 11  simCpDist(x.learn = NULL, m = NULL, n, gamma = 0.25, delta = 1e4,
B = 1000, method = c("sim", "mult"), b = NULL,
weights = c("parzen", "bartlett"), g = 5,
L.method = c("max","median","mean","min"))
threshCpDist(sims, p = 1, alpha = 0.05, type = 7)
detCpDist(x.learn, x, gamma = 0.25, delta = 1e4)
monCpDist(det, thresh, statistic = c("mac", "mmc", "mmk", "mk", "mc"),
plot = TRUE)

x.learn 
a data matrix whose rows are continuous observations, representing the learning sample. 
m 
a strictly positive integer specifying the size of the
learning sample if 
n 
a strictly positive integer specifying the monitoring horizon;
the monitoring period is 
gamma 
a real parameter between 0 and 0.5 appearing in the definition of the weight function used in the detector function. 
delta 
a real parameter between 0 and 1 appearing in the definition of the weight function used in the detector function. 
B 
the number of trajectories of the detector function to simulate under the null. 
method 
a string specifying the trajectory simulation method;
can be either 
b 
strictly positive integer specifying the value of the
bandwidth parameter determining the serial dependence when
generating dependent multiplier sequences using the 'moving average
approach'; see Section 5 of the first reference. The value 1 will
create i.i.d. multiplier sequences suitable for serially independent
observations. If set to 
weights 
a string specifying the kernel for creating the weights used in the generation of dependent multiplier sequences within the 'moving average approach'; see Section 5 of the first reference. 
g 
a strictly positive integer specifying the number of points of
the uniform grid on (0,1)^d (where d is

L.method 
a string specifying how the parameter L involved in the estimation of the bandwidth parameter is computed; see Section 5 of the first reference. 
sims 
an object of class 
p 
a strictly positive integer specifying the number of steps of
the piece constant threshold function; 
alpha 
the value of the desired significance level for the sequential test. 
type 
an integer between 1 and 9 selecting one of the nine quantile
algorithms detailed in the help of the function 
x 
a data matrix whose rows are continuous observations corresponding to the new observations to be monitored for a change in contemporary distribution. 
det 
an object of class 
thresh 
an object of class 
statistic 
a string specifying the statistic/detector to be used
for the monitoring; can be either 
plot 
logical indicating whether the monitoring should be plotted. 
The testing procedure is described in detail in the second reference.
All functions return lists whose components have explicit names. The
function monCpDist()
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

This is a test for continuous (multivariate) time series.
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, http://arxiv.org/abs/1306.3930.
I. Kojadinovic and G. Verdier (2020), Nonparametric sequential changepoint detection for multivariate time series based on empirical distribution functions, 52 pages, http://arxiv.org/abs/2004.12322.
see cpDist()
for the corresponding a posteriori (offline) test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61  ## Not run:
## Example of montoring for the period m+1, ..., n
m < 100 # size of the learning sample
n < 150 # monitoring horizon
## The learning sample
set.seed(123)
x.learn < matrix(rnorm(m))
## New observations with a large change in mean
## to simulate monitoring for the period m+1, ..., n
k < 125 ## the true changepoint
x < matrix(c(rnorm(km), rnorm(nk, mean = 2)))
## Step 1: Simulation of B trajectories of the detector functions under the null
B < 1e4
## Under the assumption of serial independence
## (no need to specify the learning sample)
traj.sim < simCpDist(m = m, n = n, B = B, method = "sim")
## Without the assumption of serial independence
## (the learning sample is compulsory; the larger it is, the better;
## the monitoring horizon n should not be too large)
traj.mult < simCpDist(x.learn = x.learn, n = n, B = B, method = "mult")
## Step 2: Compute threshold functions with p steps
p < 2
tf.sim < threshCpDist(traj.sim, p = p) # p can be taken large
# if B is very large
tf.mult < threshCpDist(traj.mult, p = p) # p should not be taken too
# large unless both m and B
# are very large
## Step 3: Compute the detectors for the monitoring period m+1, ... , n
det < detCpDist(x.learn = x.learn, x = x)
## Step 4: Monitoring
## Simulate the monitoring with the first threshold function
monCpDist(det, tf.sim)
## Simulate the monitoring with the second threshold function
monCpDist(det, tf.mult)
## Simulate the monitoring with the first threshold function
## and another detector function
monCpDist(det, tf.sim, statistic = "mmk")
## Alternative steps 3 and 4:
## Compute the detectors for the monitoring period m+1, ... , m+20 only
det < detCpDist(x.learn = x.learn, x = x[1:20,,drop = FALSE])
## Simulate the monitoring with the first threshold function
monCpDist(det, tf.sim)
## Simulate the monitoring with the second threshold function
monCpDist(det, tf.mult)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.