hcd_page_hinkley {harbinger} | R Documentation |
Change-point detection method works by computing the observed values and their mean up to the current moment doi:10.2307/2333009.
hcd_page_hinkley(
min_instances = 30,
delta = 0.005,
threshold = 50,
alpha = 1 - 1e-04
)
min_instances |
The minimum number of instances before detecting change |
delta |
The delta factor for the Page Hinkley test |
threshold |
The change detection threshold (lambda) |
alpha |
The forgetting factor, used to weight the observed value and the mean |
hcp_page_hinkley
object
library("daltoolbox")
n <- 100 # size of each segment
serie1 <- c(sin((1:n)/pi), 2*sin((1:n)/pi), 10 + sin((1:n)/pi),
10-10/n*(1:n)+sin((1:n)/pi)/2, sin((1:n)/pi)/2)
serie2 <- 2*c(sin((1:n)/pi), 2*sin((1:n)/pi), 10 + sin((1:n)/pi),
10-10/n*(1:n)+sin((1:n)/pi)/2, sin((1:n)/pi)/2)
data <- data.frame(serie1, serie2)#'
event <- rep(FALSE, nrow(data))
model <- fit(hcd_page_hinkley(threshold=3), data)
detection <- detect(model, data)
print(detection[(detection$event),])