BS.uni.nonpar {changepoints} | R Documentation |
Perform standard binary segmentation for univariate nonparametric change points detection.
BS.uni.nonpar(Y, s, e, N, delta, level = 0)
Y |
A |
s |
A |
e |
A |
N |
A |
delta |
A positive |
level |
Should be fixed as 0. |
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. |
Oscar Hernan Madrid Padilla & Haotian Xu
Padilla, Yu, Wang and Rinaldo (2021) <doi:10.1214/21-EJS1809>.
thresholdBS
for obtaining change points estimation, tuneBSuninonpar
for a tuning version.
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")