| Title: | Nonparametric Multiple Change Point Detection Using Wild Binary Segmentation |
|---|---|
| Description: | Implements a procedure for detecting multiple location-scale change points in a sequence of univariate observations, as described in Ross (2026) "Nonparametric Detection of Multiple Location-Scale Change Points via Wild Binary Segmentation" <doi:10.48550/arXiv.2107.01742>. The method combines Wild Binary Segmentation with a rank-based statistic and provides calibrated thresholds for controlling the probability of incorrectly detecting a change point in a homogeneous sequence. |
| Authors: | Gordon J. Ross [aut, cre] |
| Maintainer: | Gordon J. Ross <[email protected]> |
| License: | GPL-3 |
| Version: | 0.3.0 |
| Built: | 2026-06-01 06:56:12 UTC |
| Source: | https://github.com/cran/npwbs |
Returns the estimated number and locations of the change points in a sequence of univariate observations. For full details of how this procedure works, please see G. J. Ross (2021) - "Nonparametric Detection of Multiple Location-Scale Change Points via Wild Binary Segmentation" at https://arxiv.org/abs/2107.01742
detectChanges(y,alpha=0.05,prune=TRUE,M=10000,d=2,displayOutput=FALSE)detectChanges(y,alpha=0.05,prune=TRUE,M=10000,d=2,displayOutput=FALSE)
y |
The sequence to test for change points |
alpha |
Required Type I error (i.e. false positive) rate. Can be set to either 0.05 or 0.01 |
prune |
Whether to prune potential excess change points via post-processing. Most likely should be left as TRUE. |
M |
Number of subsequences to sample during WBS and pruning. The built-in thresholds are calibrated for |
d |
Minimum number of observations between change points. The built-in thresholds currently support only |
displayOutput |
If TRUE then will print some information while searching for change points |
The built-in thresholds are precomputed for the Lepage statistic using d = 2, M = 10000, and alpha in {0.05, 0.01}. Thresholds are calibrated up to segment length n = 10000. For n > 10000, the implementation uses the n = 10000 threshold and issues a warning. For n > 1000, the built-in thresholds use a smooth tail approximation fitted to additional Monte Carlo calibration points.
If prune = TRUE, a post-processing pruning step retests merged neighbouring segments and removes changepoints that are no longer supported.
A vector containing the detected changepoint locations. A returned value k denotes a split between observations k and k + 1, i.e. the change occurs after observation k.
Gordon J. Ross [email protected]
set.seed(100) y <- c(rnorm(30,0,1),rnorm(30,3,1), rnorm(30,0,1),rnorm(30,0,3)) detectChanges(y)set.seed(100) y <- c(rnorm(30,0,1),rnorm(30,3,1), rnorm(30,0,1),rnorm(30,0,3)) detectChanges(y)