tuneBSuninonpar {changepoints} | R Documentation |
Perform wild binary segmentation with tuning parameter selection based on sample splitting.
tuneBSuninonpar(BS_object, Y, N)
BS_object |
A "BS" object produced by |
Y |
A |
N |
A |
A vector of estimated change points (sorted in strictly increasing order).
Oscar Hernan Madrid Padilla & Haotian Xu
Padilla, Yu, Wang and Rinaldo (2021) <doi:10.1214/21-EJS1809>.
BS.uni.nonpar
and WBS.uni.nonpar
.
Y = t(as.matrix(c(rnorm(100, 0, 1), rnorm(100, 0, 10), rnorm(50, 0, 40))))
W = Y # W is a copy of the matrix Y, it can be Y itself.
N = rep(1, 250)
M = 5
set.seed(123)
intervals = WBS.intervals(M = M, lower = 1, upper = ncol(Y))
BS_object = WBS.uni.nonpar(W, 1, ncol(Y), intervals$Alpha, intervals$Beta, N, delta = 5)
cpt_hat = tuneBSuninonpar(BS_object, Y, N)