Learn R Programming

npwbs (version 0.2.0)

detectChanges: Nonparametric detection of multiple change points using Wild Binary Segmentation

Description

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

Usage

detectChanges(y,alpha=0.05,prune=TRUE,M=10000,d=2,displayOutput=FALSE)

Arguments

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. Should be left as M=10000

d

Minimum number of observations between change points. Should be left as d=2.

displayOutput

If TRUE then will print some information while searching for change points

Value

A vector containing the location of the detected change points

Examples

Run this code
# NOT RUN {
     
# }
# NOT RUN {
set.seed(100)
y <- c(rnorm(30,0,1),rnorm(30,3,1), rnorm(30,0,1),rnorm(30,0,3))
detectChanges(y)
# }

Run the code above in your browser using DataLab