Learn R Programming

fastOnlineCpt (version 1.0)

checkCpt: Test if a changepoint has occurred.

Description

Test if a changepoint has occurred.

Usage

checkCpt(obj, screenOutput = TRUE)

# S4 method for fastOnlineCpt checkCpt(obj, screenOutput = TRUE)

Arguments

obj

An object of the class "fastOnlineCpt".

screenOutput

Boolean variable to indicate if the test result for a changepoint should be printed on the screen (default TRUE).

Value

An object of the class "fastOnlineCpt".

References

Hahn, G. (2021). Online multivariate changepoint detection with type I error control and constant time/memory updates per series. Under review.

Examples

Run this code
# NOT RUN {
library(fastOnlineCpt)
alpha <- 0.01
halfspent <- 100
spending_sequence <- function(n) { (n/(n+halfspent) - (n-1)/(n-1+halfspent)) * alpha }
obj <- fastOnlineCpt(spending_sequence)
p <- 10
n <- 50
data <- matrix(rnorm(p*n,mean=0),ncol=n)
obj <- addData(obj,data)
obj <- checkCpt(obj)
data <- matrix(rnorm(p*n,mean=1),ncol=n)
obj <- addData(obj,data)
obj <- checkCpt(obj)

# }

Run the code above in your browser using DataLab