Nonparametric Change Point Detection for Multivariate Time Series

Implements the nonparametric moving sum procedure for detecting changes in the joint characteristic function (NP-MOJO) for multiple change point detection in multivariate time series. See McGonigle, E. T., Cho, H. (2025) for description of the NP-MOJO methodology.


CptNonPar

R-CMD-check Codecov testcoverage

Nonparametric change point detection for multivariate time series. Implements the NP-MOJO methodology proposed in McGonigle and Cho (2025).

Installation

You can install the released version of CptNonPar from CRAN with:

install.packages("CptNonPar")

You can install the development version of CptNonPar from GitHub with:

devtools::install_github("https://github.com/EuanMcGonigle/CptNonPar")

Usage

For further examples, see the help files within the package. We can generate an example for change point detection as follows.

We generate a univariate time series of length 1000, with a mean change at time 300, and an autocovariance (but not marginal) change at time 650. Then, we perform the multi-lag NP-MOJO algorithm with lags 0 and 1, and print the estimated change points and the associated clusters:

library(CptNonPar)

n <- 1000
set.seed(123)

noise1 <- stats::arima.sim(model = list(ar = -0.5), n = n, sd = sqrt(1 - 0.5^2))
noise2 <- stats::arima.sim(model = list(ar = 0.5), n = n, sd = sqrt(1 - 0.5^2))

noise <- c(noise1[1:650], noise2[651:n])

signal <- c(rep(0, 300), rep(0.7, 700))

x <- signal + noise

x.c <- np.mojo.multilag(x, G = 166, lags = c(0, 1))

x.c$cpts
#>      cpt lag score
#> [1,] 295   0  1.00
#> [2,] 648   1  0.99

x.c$cpt.clusters
#> [[1]]
#>      cpt lag score
#> [1,] 295   0     1
#> [2,] 296   1     1
#> 
#> [[2]]
#>      cpt lag score
#> [1,] 648   1  0.99

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("CptNonPar")

0.3.2 by Euan T. McGonigle, 8 months ago


https://github.com/EuanMcGonigle/CptNonPar


Report a bug at https://github.com/EuanMcGonigle/CptNonPar/issues


Browse source code at https://github.com/cran/CptNonPar


Authors: Euan T. McGonigle [aut, cre] , Haeran Cho [aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports Rcpp, doParallel, parallel, parallelly, foreach, Rfast, iterators, stats

Suggests covr, testthat

Linking to Rcpp


Suggested by ggchangepoint.


See at CRAN