MyNixOS website logo
Description

A Tidy Framework for Changepoint Detection Analysis.

Changepoint detection algorithms for R are widespread but have different interfaces and reporting conventions. This makes the comparative analysis of results difficult. We solve this problem by providing a tidy, unified interface for several different changepoint detection algorithms. We also provide consistent numerical and graphical reporting leveraging the 'broom' and 'ggplot2' packages.

tidychangepoint

R-CMD-check

Usage

To install tidychangepoint:

remotes::install_github("beanumber/tidychangepoint")

To load it:

library(tidychangepoint)

Tidy methods for changepoint analysis

The tidychangepoint package allows you to use any number of algorithms for detecting changepoint sets in univariate time series with a common, tidyverse-compliant interface. Currently, algorithms from changepoint, wbs, and several genetic algorithms made accessible via GA are supported. It also provides model-fitting procedures for commonly-used parametric models, tools for computing various penalty functions, and graphical diagnostic displays.

Changepoint sets are computed using the segment() function, which takes a numeric vector that is coercible into a ts object, and a string indicating the algorithm you wish you use. segment() always returns a tidycpt object.

x <- segment(CET, method = "pelt", minseglen = 3)
class(x)
## [1] "tidycpt"

Various methods are available for tidycpt objects. For example, as.ts() returns the original data as ts object, and changepoints() returns the set of changepoint indices.

changepoints(x)
## [1] 237 330

If the original time series has time labels, we can also retrieve that information.

changepoints(x, use_labels = TRUE)
## [1] "1895-01-01" "1988-01-01"

The fitness() function returns the both the value and the name of the objective function that the algorithm used to find the optimal changepoint set.

fitness(x)
##     MBIC 
## 643.5292

References

Please read the full paper for more details.

To cite the package, use the following information:

citation("tidychangepoint")
## Warning in citation("tidychangepoint"): could not determine year for
## 'tidychangepoint' from package DESCRIPTION file

## To cite package 'tidychangepoint' in publications use:
## 
##   Baumer B, Suarez Sierra B, Coen A, Taimal C (????). _tidychangepoint:
##   Facilitate Changepoint Detection Analysis in a Tidy Framework_. R
##   package version 0.0.1,
##   <https://beanumber.github.io/tidychangepoint/>.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {tidychangepoint: Facilitate Changepoint Detection Analysis in a Tidy Framework},
##     author = {Benjamin S. Baumer and Biviana Marcela {Suarez Sierra} and Arrigo Coen and Carlos A. Taimal},
##     note = {R package version 0.0.1},
##     url = {https://beanumber.github.io/tidychangepoint/},
##   }
Metadata

Version

0.0.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows