Runs a set of detectors on one series and reports the locations they agree
on. Two detections count as the same changepoint when they fall within
tolerance of each other — the same tolerance window
cpt_metrics() matches on (van den Burg and Williams, 2020),
so the package has one notion of "close enough" and not two. The
grouping necessarily differs: cpt_metrics() matches two
sets one-to-one, while consensus has to cluster \(K\) of them, so
detections are swept in order and a new cluster opens as soon as one lies
more than tolerance from the cluster's first member. That cap stops
a chain of near-neighbours merging into one arbitrarily wide cluster.
Arguments
- x
A
ggcpt_consensusobject (forprint()).- methods
Character vector of method names.
- tolerance
Matching window, in positions. Defaults to
5.- min_votes
Minimum number of methods that must find a location for it to enter the consensus. Defaults to
2; pass a fraction in \((0, 1)\) for a proportion of the methods that ran.- change_in
Passed to each detector.
- index
Optional time index, carried onto the result.
- seed
Optional seed for reproducibility.
- ...
Passed on to
autoplot.ggcpt()forplot_type = "series".- object
A
ggcpt_consensusobject (forautoplot()).- plot_type
"series"(the consensus segmentation, votes shown by line width) or"agreement"(a method-by-location dot matrix showing exactly who voted for what).
Value
A ggcpt object (so it plots and tidies like any other
result) whose changepoints tibble carries votes and
methods (a comma-separated list of the methods that found each
location), with the per-method detections kept in a
consensus attribute and printed by autoplot(type =
"agreement").
Consensus is not inference
Agreement among detectors is not a p-value, and a location found
by six of seven methods is not thereby significant at any level: the
methods are run on the same data and are strongly correlated, several of
them share an engine, and none of the votes is independent. Read the vote
count as a robustness display — "this feature does not depend on which
detector I picked" — and use nsp_wrapper() or
cpt_confint() when you need a guarantee.
References
van den Burg GJJ, Williams CKI (2020). “An evaluation of change point detection algorithms.” arXiv preprint arXiv:2003.06222. doi:10.48550/arXiv.2003.06222 .

