BS.uni.nonpar {changepoints}R Documentation

Standard binary segmentation for univariate nonparametric change points detection.

Description

Perform standard binary segmentation for univariate nonparametric change points detection.

Usage

BS.uni.nonpar(Y, s, e, N, delta, level = 0)

Arguments

Y

A numeric matrix of observations with horizontal axis being time, and vertical axis being multiple observations on each time point.

s

A integer scalar of starting index.

e

A integer scalar of ending index.

N

A integer vector representing number of multiple observations on each time point.

delta

A positive integer scalar of minimum spacing.

level

Should be fixed as 0.

Value

An object of class "BS", which is a list with the following structure:

S

A vector of estimated change points (sorted in strictly increasing order).

Dval

A vector of values of CUSUM statistic based on KS distance.

Level

A vector representing the levels at which each change point is detected.

Parent

A matrix with the starting indices on the first row and the ending indices on the second row.

Author(s)

Oscar Hernan Madrid Padilla & Haotian Xu

References

Padilla, Yu, Wang and Rinaldo (2021) <doi:10.1214/21-EJS1809>.

See Also

thresholdBS for obtaining change points estimation, tuneBSuninonpar for a tuning version.

Examples

Y = t(as.matrix(c(rnorm(100, 0, 1), rnorm(100, 0, 10), rnorm(100, 0, 40))))
N = rep(1, 300)
temp = BS.uni.nonpar(Y, 1, 300, N, 5)
plot.ts(t(Y))
points(x = tail(temp$S[order(temp$Dval)],4), y = Y[,tail(temp$S[order(temp$Dval)],4)], col = "red")

[Package changepoints version 1.1.0 Index]