Skip to contents

Core API

cpt_detect()
Unified changepoint detection dispatcher
cpt_methods()
Introspect available changepoint detection methods
cpt_families()
Distribution families, and what each request runs
cpt_penalty()
Construct changepoint penalties
cpt_cite()
Cite the method behind a result
as_cpt_series()
Coerce a time series object to values plus a time index
new_ggcpt()
Create a ggcpt object
is_ggcpt()
Test if an object is a ggcpt object
print(<ggcpt>)
Print a ggcpt object
cpt_verify() print(<ggcpt_verification>) tidy(<ggcpt_verification>)
Re-run a result against the engines installed now

The contract

What code that calls the package can rely on: the classed conditions it raises, and the versioned JSON schema a result is written in.

ggchangepoint-conditions ggchangepoint_error ggchangepoint_warning
Conditions raised by ggchangepoint
as_json()
Convert a result to JSON
cpt_export() cpt_import()
Write a result to a file, and read it back

Extending the package

Bring a detector this package does not wrap (a non-CRAN engine, a Python tool, a neural detector, or your own changepoints) into the same tidy, plottable grammar.

as_ggcpt()
Turn external changepoints into a ggcpt result
cpt_register_method() cpt_unregister_method() cpt_registered_methods()
Register an external changepoint detector
cpt_install_engines()
Install the engines behind a family of methods

Original wrappers

cpt_wrapper()
Changepoint wrapper
ecp_wrapper()
ecp wrapper

Search and pruning wrappers

fpop_wrapper()
FPOP wrapper: Functional Pruning Optimal Partitioning
wbs_wrapper()
WBS wrapper: Wild Binary Segmentation
wbs2_wrapper()
WBS2 wrapper: Wild Binary Segmentation 2
not_wrapper()
NOT wrapper: Narrowest-Over-Threshold
mosum_wrapper()
MOSUM wrapper: Moving Sum
idetect_wrapper()
Isolate-Detect wrapper
tguh_wrapper()
TGUH wrapper

Inference and slope wrappers

smuce_wrapper()
SMUCE / HSMUCE wrapper: multiscale changepoint inference
cpop_wrapper()
CPOP wrapper: optimal change-in-slope detection
nsp_wrapper()
NSP wrapper: Narrowest Significance Pursuit
cpt_crops() autoplot(<ggcpt_path>) print(<ggcpt_path>) tidy(<ggcpt_path>)
CROPS: the full penalty path of a penalised changepoint method

Inference

Where could this changepoint be, is it real, and which coordinates changed?

cpt_confint()
Confidence intervals for changepoint locations
cpt_confint_coverage() print(<ggcpt_coverage>) tidy(<ggcpt_coverage>) autoplot(<ggcpt_coverage>)
How often do the confidence intervals cover? A Monte Carlo check
cpt_test()
Test detected changepoints
cpt_regions()
Tidy the significance regions of a ggcpt object
cpt_attribute() print(<ggcpt_attribution>) tidy(<ggcpt_attribution>) glance(<ggcpt_attribution>) autoplot(<ggcpt_attribution>)
Which coordinates changed? Certified attribution for a multivariate fit
cpt_screen() print(<ggcpt_screen>) tidy(<ggcpt_screen>) glance(<ggcpt_screen>) autoplot(<ggcpt_screen>)
Which of many series changed? Screening with error control across the panel

Effects, dates and empty answers

How big was the change, did anything change at a date fixed in advance, was the change the event you know about, and what does “no changepoints” mean.

cpt_effect() print(<ggcpt_effect>) tidy(<ggcpt_effect>) autoplot(<ggcpt_effect>)
Effect size at each changepoint
cpt_test_at() print(<ggcpt_test_at>) tidy(<ggcpt_test_at>)
Test for a change at a date fixed in advance
cpt_attribute_event()
Was a detected change the event you have in mind?
cpt_test_null()
Test for a change anywhere in a series
cpt_null_power() print(<ggcpt_null_power>) tidy(<ggcpt_null_power>)
What an empty answer could have detected

Segment models

A model per regime, a forecast from the last one, and what would have happened without each change.

cpt_segment_models() tidy(<ggcpt_segment_models>) glance(<ggcpt_segment_models>) print(<ggcpt_segment_models>)
Fit a model to every segment of a segmentation
predict(<ggcpt>)
Forecast from a segment of a segmentation
cpt_counterfactual() print(<ggcpt_counterfactual>) tidy(<ggcpt_counterfactual>) glance(<ggcpt_counterfactual>) autoplot(<ggcpt_counterfactual>)
What would have happened without the change? Observed against counterfactual

Choosing the number of changepoints

Diagnostics

Which observation is driving this, which setting, and what did the detector actually compute?

cpt_influence() print(<ggcpt_influence>) autoplot(<ggcpt_influence>) tidy(<ggcpt_influence>)
Influence diagnostics for a changepoint segmentation
cpt_leverage()
Rank observations by influence
cpt_sensitivity() print(<ggcpt_sensitivity>) tidy(<ggcpt_sensitivity>) autoplot(<ggcpt_sensitivity>)
Sensitivity of a segmentation to its tuning parameters
cpt_statistic() ggcpt_statistic()
The detector's statistic as a function of location
cpt_solution_path() ggcpt_solution_path()
The solution path of a search-based detector
cpt_scale_space() ggcpt_scale_space()
Scale space: the statistic across bandwidths

Assumptions and robustness

Do the result’s assumptions hold for this series, and does the answer survive a change of noise model?

cpt_assumptions() print(<ggcpt_assumptions>) tidy(<ggcpt_assumptions>)
Check the assumptions behind a segmentation
cpt_gof() print(<ggcpt_gof>) tidy(<ggcpt_gof>)
Goodness of fit, segment by segment
cpt_abruptness() print(<ggcpt_abruptness>) tidy(<ggcpt_abruptness>) autoplot(<ggcpt_abruptness>)
Was the change abrupt? A step against a ramp, at every changepoint
cpt_robustness() print(<ggcpt_robustness>) tidy(<ggcpt_robustness>) autoplot(<ggcpt_robustness>)
Does a changepoint survive a change of noise model?

Supervised detection

Labelled regions as ground truth, label errors as the accuracy measure, and a learned penalty.

Choosing and combining methods

Communication

cpt_annotate_events() print(<ggcpt_events>) tidy(<ggcpt_events>) autoplot(<ggcpt_events>)
Match detected changepoints to known events
cpt_report()
A reproducible report of a changepoint analysis
cpt_gt()
A publication-ready changepoint table

Benchmarking

cpt_benchmark() print(<ggcpt_benchmark>) tidy(<ggcpt_benchmark>) autoplot(<ggcpt_benchmark>)
Benchmark detectors across datasets
cpt_datasets()
A catalogue of benchmark datasets
cpt_load_tcpd()
Download and cache the Turing Change Point Dataset
cpt_annotations()
Per-annotator ground truth for a benchmark dataset

Streaming and online monitoring

cpt_monitor() tidy(<ggcpt_monitor>) print(<ggcpt_monitor>) autoplot(<ggcpt_monitor>)
A stateful sequential changepoint monitor
cpt_update()
Feed observations to a monitor
alarms()
The alarm log of a monitor
cpt_replay()
Replay a series through a sequential detector
cpt_delay() tidy(<ggcpt_delay>) glance(<ggcpt_delay>) print(<ggcpt_delay>) autoplot(<ggcpt_delay>)
Detection delay and false-alarm rate

Power and study design

cpt_power() tidy(<ggcpt_power>) print(<ggcpt_power>) autoplot(<ggcpt_power>)
Detection power for a changepoint scenario
cpt_min_detectable() tidy(<ggcpt_min_detectable>) print(<ggcpt_min_detectable>)
The smallest detectable change
cpt_scenarios()
A grid of simulation scenarios

Bayesian wrappers

bcp_wrapper()
Bayesian changepoint wrapper (Barry-Hartigan product partition model)
bocpd_wrapper()
Bayesian online changepoint detection wrapper (BOCPD)
beast_wrapper()
BEAST wrapper: Bayesian estimation of abrupt change, seasonality, and trend

Nonparametric and sequential wrappers

cpm_wrapper()
Sequential change point model wrapper (CPM)
kcp_wrapper()
Kernel changepoint wrapper (KCP on running statistics)
npmojo_wrapper()
Nonparametric MOSUM wrapper (NP-MOJO)
sn_wrapper()
Self-normalisation wrapper (SNSeg)

Robust and model-selection wrappers

decafs_wrapper()
DeCAFS wrapper: changes amid drift and autocorrelated noise
envcpt_wrapper()
EnvCpt wrapper: changepoints versus trends versus autocorrelation
fastcpd_wrapper()
fastcpd wrapper: fast changepoint detection via sequential gradient descent

Multivariate and high-dimensional wrappers

inspect_wrapper()
inspect wrapper: high-dimensional changepoints via sparse projection
ocd_wrapper()
ocd wrapper: online high-dimensional changepoint detection
geomcp_wrapper()
Geometrically-inspired multivariate changepoint wrapper (geomcp)
esac_wrapper()
ESAC wrapper: sparsity-adaptive high-dimensional detection
pilliat_wrapper()
Pilliat wrapper: high-dimensional detection by three complementary tests
hdcov_wrapper()
High-dimensional covariance changepoints
network_wrapper()
Dynamic-network changepoints
var_wrapper()
VAR(1) changepoints
hdreg_wrapper()
High-dimensional regression changepoints

Functional and network wrappers

fmean_wrapper()
Functional mean changepoints
fcov_wrapper()
Functional covariance changepoints
kwc_wrapper()
Robust depth-based changepoints for functional and multivariate data
fabisearch_wrapper()
Network-structure changepoints via non-negative matrix factorisation

Regression-break wrappers

strucchange_wrapper()
Bai-Perron structural break wrapper (strucchange)
segmented_wrapper()
Broken-line regression wrapper (segmented)
bfast_wrapper()
BFAST wrapper: breaks for additive season and trend

Applied vocabularies and fast paths

trend_wrapper()
Classical single-changepoint tests (Pettitt, Buishand, SNHT)
taylor_wrapper()
Taylor's change point analyzer
wbsts_wrapper()
WBS for nonstationary time series
binsegrcpp_wrapper()
Fast binary segmentation across loss functions

Epidemic changes and anomalies

Stretches that leave a baseline and return to it, and single outliers.

capa_wrapper()
CAPA wrapper: collective and point anomalies (epidemic changepoints)

Bayesian formula models

mcp_wrapper()
Bayesian formula-based changepoint regression (mcp)

broom methods

tidy(<ggcpt>)
Tidy a ggcpt object
glance(<ggcpt>)
Glance at a ggcpt object
augment(<ggcpt>)
Augment a ggcpt object
summary(<ggcpt>) print(<summary.ggcpt>)
Summary of a ggcpt object

Additional S3 methods

Theming, palettes and accessibility

theme_ggcpt()
ggchangepoint theme
annotate_segments()
Annotate segments with alternating shading
scale_colour_cpt() scale_color_cpt() scale_fill_cpt() scale_linetype_cpt()
Colour-vision-safe scales for changepoint methods
scale_fill_cpt_label() scale_colour_cpt_label()
Colour scales for changepoint labels and label errors

Visualization

autoplot(<ggcpt>)
Autoplot a ggcpt object
ggcptplot()
Plot for the changepoint package
ggecpplot()
Plot for the ecp package
geom_changepoint()
Changepoint vertical rules geom
geom_cpt_segment()
Changepoint segment level geom
geom_cpt_ci()
Changepoint confidence interval geom
geom_cpt_region()
Significance region geom
geom_cpt_label()
Changepoint label geom
geom_cpt_event()
Event annotation geom
stat_changepoint()
Changepoint detection stat
stat_cpt_region()
Significance regions computed in the layer
ggchangepoint-ggproto GeomChangepoint GeomCptSegment GeomCptCi GeomCptRegion GeomCptLabel GeomCptEvent StatChangepoint StatCptRegion
ggproto objects for the changepoint layers
ggcpt_posterior()
Posterior probability plot for Bayesian results
ggcpt_runlength()
Run-length posterior heatmap for Bayesian online results
ggcpt_interactive()
Interactive changepoint plot

Method comparison, batch, and stability

ggcpt_compare()
Compare multiple changepoint detection methods
ggcpt_compare_table()
Comparison table
cpt_batch() print(<ggcpt_batch>) tidy(<ggcpt_batch>) autoplot(<ggcpt_batch>)
Batch changepoint detection over many series
cpt_stability() print(<ggcpt_stability>) tidy(<ggcpt_stability>) autoplot(<ggcpt_stability>)
Changepoint stability diagnostics via bootstrap

Evaluation

cpt_metrics()
Changepoint accuracy metrics
cpt_metrics_annotated()
Multi-annotator evaluation
ggcpt_eval()
Evaluation visualization

Simulation and data

cpt_simulate() rcpt()
Generate simulated changepoint data
signal_blocks()
Blocks test signal
signal_fms()
FMS (Four-Metric-Segments) test signal
signal_mix()
Mix test signal
signal_teeth()
Teeth test signal
signal_stairs()
Stairs test signal

Measurements

What the engines were measured to do at this release: runtimes, invariances, false positives under four noise regimes and four data types, and false alarms on pure noise. cpt_methods() and cpt_recommend() read them.

cpt_runtimes
Engine runtimes by series length
cpt_invariances
Invariances of every engine's answer
cpt_noise_benchmark
False positives and power under four noise regimes
cpt_data_types
False positives and power by data type
cpt_null_sizes
False alarms on pure noise at scale
cpt_calibration
What the package promises, against what it delivers

Re-exports

reexports tidy glance augment autoplot as_tibble
Objects exported from other packages