detector <- regime_detector(method = "bocpd",
prior = normal_gamma(),
threshold = 0.5)
# \donttest{
for (x in rnorm(100)) {
detector <- update(detector, x)
if (detector$last_result$alarm) {
message("Change detected at observation ", detector$last_result$t)
detector <- reset(detector)
}
}
# }
Run the code above in your browser using DataLab