Orders the observations of a cpt_influence() result by how
much perturbing them disturbs the segmentation, most influential first.
The composite leverage score is the sum of three standardised
components (the change in the number of changepoints, the largest
movement of a changepoint, and the largest change in a segment
parameter), so an observation that shifts a location without changing the count is
still ranked.
Arguments
- object
A
ggcpt_influenceobject, or aggcptobject (in which casecpt_influence()is run first).- ...
Passed to
cpt_influence()whenobjectis aggcpt.
Value
A tibble ordered most influential first, with columns
index, delta_n_cp, max_shift,
param_shift and leverage.
Rows with leverage = NA come first, and they are the
most influential of all. max_shift and param_shift
are undefined for a perturbation that left the engine with no
changepoints at all (there is nothing to match against and no
parameters to compare), so the composite score cannot be formed for
an observation whose removal destroys the segmentation entirely. The
NA is kept rather than filled in with a fabricated number;
read the delta_n_cp column on those rows, which says how many
changepoints were lost.
An NA here is always that case. If the original fit
found no changepoints then max_shift is missing for every
observation, the standardisation returns zeros rather than
NAs, and every leverage is finite. A perturbation whose
re-fit failed is not one of these: it carries
delta_n_cp = NA as well and is sorted last, since nothing is
known about it.
