| fastOnlineCpt-class {fastOnlineCpt} | R Documentation |
S4 class providing functionality to detect multivariate changepoints in an online setting.
Description
Provides method "addData" to add new incoming data for one or more time points, "checkCpt" to test for a changepoint, "lastCptTest" to query the last test result of the function "checkCpt", and "resetAlgorithm" to reset the algorithm in order to detect a new changepoint.
Slots
spending_sequenceA function handle which returns a testing level used in multiple testing.
dataEnvironment variable to store incoming data as a matrix.
TThe current time point.
SInternal variable of the algorithm (modified cusum statistic).
sInternal variable of the algorithm (modified cusum statistic).
nTestInternal variable of the algorithm (counter for the multiple testing correction).
lastCptTestInternal variable to store the last test result, which can be queried with a member function.
References
Hahn, G. (2021). Online multivariate changepoint detection with type I error control and constant time/memory updates per series. Under review.
Examples
library(fastOnlineCpt)
alpha <- 0.01
halfspent <- 100
spending_sequence <- function(n) { (n/(n+halfspent) - (n-1)/(n-1+halfspent)) * alpha }
obj <- fastOnlineCpt(spending_sequence)