| cpt_delay | R Documentation |
Scores an online result the way the sequential literature does: how long
after each true change did the first alarm arrive, and how many alarms
were raised with no change behind them. cpt_metrics() is the
wrong tool for an online detector: it asks whether the location
was recovered, which a sequential procedure never claims. It will not
stop you: cpt_metrics() takes bare integer vectors and never
sees which detector produced them, so it cannot know. (An earlier
version of this sentence said it warns. It does not, and given that
signature it could not.)
cpt_delay(object, truth, max_delay = Inf)
## S3 method for class 'ggcpt_delay'
tidy(x, ...)
## S3 method for class 'ggcpt_delay'
glance(x, ...)
## S3 method for class 'ggcpt_delay'
print(x, ...)
## S3 method for class 'ggcpt_delay'
autoplot(object, ...)
object |
A |
truth |
Integer vector of true changepoint positions, on the same
clock as the alarms. When |
max_delay |
Alarms further than this after a change are treated as
false alarms rather than late detections. Defaults to |
x |
A |
... |
Ignored. |
A ggcpt_delay object: a list with per_change (one
row per true change: truth, alarm, delay,
detected), false_alarms, and the summary statistics
mean_delay, median_delay, n_false_alarms and
arl: monitored observations per false alarm. The baseline a
cpt_replay() monitor trained on is not counted, because
no alarm can fire there; n_obs is the length of the stream in
series positions, baseline included.
cpt_monitor(), cpt_replay().
set.seed(2026)
mon <- cpt_replay(c(rnorm(200), rnorm(200, 3)), method = "edetector")
cpt_delay(mon, truth = 200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.