MyNixOS website logo
Description

A Collection of Change-Point Detection Methods.

Performs a series of offline and/or online change-point detection algorithms for 1) univariate mean: <doi:10.1214/20-EJS1710>, <arXiv:2006.03283>; 2) univariate polynomials: <doi:10.1214/21-EJS1963>; 3) univariate and multivariate nonparametric settings: <doi:10.1214/21-EJS1809>, <doi:10.1109/TIT.2021.3130330>; 4) high-dimensional covariances: <doi:10.3150/20-BEJ1249>; 5) high-dimensional networks with and without missing values: <doi:10.1214/20-AOS1953>, <arXiv:2101.05477>, <arXiv:2110.06450>; 6) high-dimensional linear regression models: <arXiv:2010.10410>, <arXiv:2207.12453>; 7) high-dimensional vector autoregressive models: <arXiv:1909.06359>; 8) high-dimensional self exciting point processes: <arXiv:2006.03572>; 9) dependent dynamic nonparametric random dot product graphs: <arXiv:1911.07494>; 10) univariate mean against adversarial attacks: <arXiv:2105.10417>.

A collection of change-point localisation methods.

R-CMD-check Last-changedate license

Performs a series of offline and/or online change-point localisation algorithms for

  1. univariate mean
  2. univariate polynomials
  3. univariate and multivariate nonparametric settings
  4. high-dimensional covariances
  5. high-dimensional networks with and without missing values
  6. high-dimensional linear regression models
  7. high-dimensional vector autoregressive models
  8. high-dimensional self exciting point processes
  9. dependent dynamic nonparametric random dot product graphs
  10. robust univariate mean against adversarial attacks

Installation

Users must have a (C++) compiler installed on their machine that is compatible with R (e.g. Clang). The development version of changepoints from GitHub can be installed with:

## if not installed
## Install dependencies
install.packages(c("devtools","glmnet","gglasso","ks","data.tree"))

## install.packages("devtools")
devtools::install_github("HaotianXu/changepoints")

Example

This is an example for offline univariate mean change point detection by $l_0$ penalization:

library(changepoints)
## simulate data with true change points being 50, 100 and 150
set.seed(0)
y = c(rep(0, 50), rep(2, 50), rep(0, 50), rep(-2, 50)) + rnorm(200, mean = 0, sd = 1)
## estimate change points by l_0 penalization
gamma_set = c(0.01, 0.5, 1, 5, 10, 50) # possible value of tuning parameter
## perform cross-validation
DP_result = CV.search.DP.univar(y, gamma_set, delta = 5)
## estimate change points and perform local refinement
min_idx = which.min(DP_result$test_error)
cpt_DP_hat = unlist(DP_result$cpt_hat[[min_idx]])
cpt_DP_LR = local.refine.univar(cpt_DP_hat, y)

Alternatively, wild binary segmentation can also be performed:

## generate random intervals for WBS
intervals = WBS.intervals(M = 100, lower = 1, upper = 200)
## perform WBS
WBS_result = WBS.univar(y, 1, 200, intervals$Alpha, intervals$Beta, delta = 5)
WBS_result
## trim binary tree with threshold being 3
WBS_trimmed = thresholdBS(WBS_result, tau = 3)
## print the trimmed binary tree
print(WBS_trimmed$BS_tree_trimmed, "value")
## estimate change points and perform local refinement
cpt_WBS_hat = sort(WBS_trimmed$cpt_hat[,1])
cpt_BS_LR = local.refine.univar(cpt_WBS_hat, y)

wild binary segmentation with tuning parameter selected by information criteria :

WBS_CPD_result = tuneBSunivar(WBS_result, y)
WBS_CPD_LR = local.refine.univar(WBS_CPD_result$cpt, y)
Metadata

Version

1.1.0

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