| ChangepointDetector {ocd} | R Documentation |
Constructor for the ChangepointDetector S3 class
Description
Constructor for the ChangepointDetector S3 class
Usage
ChangepointDetector(dim, method = c("ocd", "Mei", "XS", "Chan"), thresh,
patience = 5000, MC_reps = 100, beta = 1, sparsity = "auto",
b = beta/sqrt(dim), p0 = 1/sqrt(dim), w = 200, lambda = sqrt(8) -
2)
Arguments
dim |
Data dimension, all new data must be of this dimension |
method |
Four methods are implemented: |
thresh |
A numeric vector or the character string 'MC'. If 'MC' is
specified then the correct threshold will be computed by Monte Carlo
simulation (the |
patience |
Required patience (average run length without change) of the online changepoint procedure. This is optional if the thresholds for detection are manually specified, but is required if Monte Carlo thresholds are used. |
MC_reps |
Number of Monte Carlo repetitions to use to estimate the
thresholds. Only used when |
beta |
lower bound on the l_2 norm of the vector of mean change to be
detected. This argument is used by the |
sparsity |
Parameter used by the |
b |
Lower bound on the per-coordinate magnitude of mean change be
detected. This argument is used by the 'Mei' method. If |
p0 |
A real number between 0 and 1. Sparsity parameter used by |
w |
Window size parameter used by |
lambda |
A tuning parameter used by the |
Details
This function is a wrapper. The new_OCD,
new_Mei, new_XS and new_Chan carry
out the actual constructor implementation.
Value
An object of S3 class 'ChangepointDetector'. Depending on the
method argument specified, the object also belongs to a subclass
'OCD', 'Mei', 'XS' or 'Chan' corresponding to method='ocd'. It
contains the following attributes:
class - S3 class and subclass
data_dim - data dimension
method - method used for changepoint detection
param - a list of parameters used in the specific method:
betaandsparsityfor methodocd;bfor methodMei;p0andwfor methodXS;p0,wandlambdafor methodChan.threshold - a named vector of thresholds used for detection (see the
threshargument)n_obs - number of observations, initialised to 0
baseline_mean - vector of pre-change mean, initialised to a vector of 0, can be estimated by setting the changepoint detector into baseline mean and standard deviation estimating status, see
setStatus, or set directly usingsetBaselineMean.baseline_sd - vector of standard deviation, initialised to a vector of 1, can be estimated by setting the changepoint detector into baseline mean and standard deviation estimating status, see
setStatus, or set directly usingsetBaselineSD.tracked - a list of information tracked online by the changepoint detector: matrices
Aandtailfor methodocd; vectorRfor methodMei; matricesX_recentandCUSUMfor methodsXSandChan.statistics - a named vector of test statistics for changepoint detection: statistics with names
diag,off_dandoff_sfor methodocd(note ifsparsityis'dense'or'sparse', then only (S^diag, S^off,d) and (S^diag, S^off,s) are included instatrespectively.); statistics with namesmaxandsumfor methodMei; a single numeric value for methodsXSandChan.status - one of the following: 'estimating' (the detector is estimating the baseline mean and standard deviation with new data points), 'monitoring' (the detector is detecting changes from the baseline mean from new data points) and an integer recording the time of declaration of changepoint.
References
Chen, Y., Wang, T. and Samworth, R. J. (2020) High-dimensional multiscale online changepoint detection Preprint. arxiv:2003.03668.
Mei, Y. (2010) Efficient scalable schemes for monitoring a large number of data streams. Biometrika, 97, 419–433.
Xie, Y. and Siegmund, D. (2013) Sequential multi-sensor change-point detection. Ann. Statist., 41, 670–692.
Chan, H. P. (2017) Optimal sequential detection in multi-stream data. Ann. Statist., 45, 2736–2763.
See Also
accessor functions such as data_dim, the main function
for processing a new data point getData, other methods for the
ChangepointDetector class including reset,
setBaselineMean, setBaselineSD,
setStatus, normalisedStatistics and
checkChange.
Examples
detector_ocd <- ChangepointDetector(dim=100, method='ocd',
thresh=c(11.6, 179.5, 54.9), beta=1)
detector_Mei <- ChangepointDetector(dim=100, method='Mei',
thresh=c(8.6, 125.1), b=0.1)
detector_XS <- ChangepointDetector(dim=100, method='XS', thresh=55.1)
detector_Chan <- ChangepointDetector(dim=100, method='Chan', thresh=8.7)