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_sequence

A function handle which returns a testing level used in multiple testing.

data

Environment variable to store incoming data as a matrix.

T

The current time point.

S

Internal variable of the algorithm (modified cusum statistic).

s

Internal variable of the algorithm (modified cusum statistic).

nTest

Internal variable of the algorithm (counter for the multiple testing correction).

lastCptTest

Internal 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)


[Package fastOnlineCpt version 1.0 Index]