Table of Contents
Fetching ...

tidychangepoint: A Unified Framework for Analyzing Changepoint Detection in Univariate Time Series

Benjamin S. Baumer, Biviana Marcela Suarez Sierra

TL;DR

The paper introduces tidychangepoint, an R package that unifies disparate changepoint detection tools under a single, tidyverse-compatible interface. It wraps algorithms from multiple packages (e.g., PELT, WBS, segmented) and supports both deterministic methods and flexible genetic algorithms, all returning results in a common tidycpt object. This standardization facilitates direct, programmatic comparison of results across algorithms, models, and penalty functions, and provides utilities for extracting, plotting, and diagnosing results within a cohesive framework. The work demonstrates the practical utility of the approach through examples and discusses extensibility, benchmarking, and future directions for incorporating additional methods and data sets.

Abstract

We present tidychangepoint, a new R package for changepoint detection analysis. Most R packages for segmenting univariate time series focus on providing one or two algorithms for changepoint detection that work with a small set of models and penalized objective functions, and all of them return a custom, nonstandard object type. This makes comparing results across various algorithms, models, and penalized objective functions unnecessarily difficult. tidychangepoint solves this problem by wrapping functions from a variety of existing packages and storing the results in a common S3 class called tidycpt. The package then provides functionality for easily extracting comparable numeric or graphical information from a tidycpt object, all in a tidyverse-compliant framework. tidychangepoint is versatile: it supports both deterministic algorithms like PELT (from changepoint), and also flexible, randomized, genetic algorithms (via GA) that -- via new functionality built into tidychangepoint -- can be used with any compliant model-fitting function and any penalized objective function. By bringing all of these disparate tools together in a cohesive fashion, tidychangepoint facilitates comparative analysis of changepoint detection algorithms and models.

tidychangepoint: A Unified Framework for Analyzing Changepoint Detection in Univariate Time Series

TL;DR

The paper introduces tidychangepoint, an R package that unifies disparate changepoint detection tools under a single, tidyverse-compatible interface. It wraps algorithms from multiple packages (e.g., PELT, WBS, segmented) and supports both deterministic methods and flexible genetic algorithms, all returning results in a common tidycpt object. This standardization facilitates direct, programmatic comparison of results across algorithms, models, and penalty functions, and provides utilities for extracting, plotting, and diagnosing results within a cohesive framework. The work demonstrates the practical utility of the approach through examples and discusses extensibility, benchmarking, and future directions for incorporating additional methods and data sets.

Abstract

We present tidychangepoint, a new R package for changepoint detection analysis. Most R packages for segmenting univariate time series focus on providing one or two algorithms for changepoint detection that work with a small set of models and penalized objective functions, and all of them return a custom, nonstandard object type. This makes comparing results across various algorithms, models, and penalized objective functions unnecessarily difficult. tidychangepoint solves this problem by wrapping functions from a variety of existing packages and storing the results in a common S3 class called tidycpt. The package then provides functionality for easily extracting comparable numeric or graphical information from a tidycpt object, all in a tidyverse-compliant framework. tidychangepoint is versatile: it supports both deterministic algorithms like PELT (from changepoint), and also flexible, randomized, genetic algorithms (via GA) that -- via new functionality built into tidychangepoint -- can be used with any compliant model-fitting function and any penalized objective function. By bringing all of these disparate tools together in a cohesive fashion, tidychangepoint facilitates comparative analysis of changepoint detection algorithms and models.
Paper Structure (3 sections, 1 figure)

This paper contains 3 sections, 1 figure.

Figures (1)

  • Figure 1: Mean annual temperature in degrees Celsius, as measured in Hadley Centre, England, 1659-2024. Plot created by plot.xts().