| cpt_solution_path | R Documentation |
The order in which candidate changepoints entered the model, with the contrast (or split criterion) at each step. Binary segmentation splits recursively, WBS/WBS2/NOT/TGUH rank random intervals; in every case the final answer is a prefix of a path, and seeing the path shows how decisively each changepoint beat the next.
cpt_solution_path(object)
ggcpt_solution_path(object, max_steps = 40)
object |
A |
max_steps |
Longest prefix of the path drawn. Defaults to |
cpt_solution_path() returns a tibble with step,
cp, contrast and, for interval-based searches,
start/end of the interval that proposed it, plus a
selected flag marking the changepoints in the final model.
ggcpt_solution_path() draws it.
contrast is the engine's own ordering criterion, and it is a
different quantity per engine: a penalty value for
binseg/segneigh (from
changepoint::pen.value.full()), |CUSUM| for wbs,
|max.contrast| for not, and
breakfast's candidate criterion for wbs2/tguh.
The values order the candidates within one result; they are not
comparable across engines, and the plot legend names the quantity
rather than calling all of them "Contrast".
For wbs2 and tguh the path is recomputed with
breakfast, because their fit objects do not keep the candidate
list. wbs2's search is randomised, so its path is a second
search of the same series rather than a record of the first: it can
differ between calls, and selected can be FALSE
throughout if the recomputed candidates miss the fit's own
changepoints. Every other engine's path is read off the fit.
cpt_statistic(), cpt_crops() for the
penalty path of an optimal-partitioning method.
set.seed(2026)
fit <- cpt_detect(c(rnorm(150), rnorm(150, 3)), method = "binseg")
cpt_solution_path(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.