detection_check {VARDetect} | R Documentation |
Function for detection performance check
Description
Function for detection performance check
Usage
detection_check(pts.final, brk, nob, critval = 5)
Arguments
pts.final |
a list of estimated change points |
brk |
the true change points |
nob |
length of time series |
critval |
critical value for selection rate. Default value is 5. Specifically, to compute the selection rate, a selected break point is counted as a “success” for the |
Value
a matrix of detection summary results, including the absolute error, selection rate and relative location. The absolute error of the locations of the estimated break points is defined as {error}_j =|\tilde{t}_j^f - t_j|
, j = 1,\dots, m_0
.
Examples
# an example of 10 replicates result
set.seed(1)
nob <- 1000
brk <- c(333, 666, nob+1)
cp.list <- vector('list', 10)
for(i in 1:10){
cp.list[[i]] <- brk[1:2] + sample(c(-50:50),1)
}
# some replicate fails to detect all the change point
cp.list[[2]] <- cp.list[[2]][1]
cp.list[4] <- list(NULL) # setting 4'th element to NULL.
# some replicate overestimate the number of change point
cp.list[[3]] <- c(cp.list[[3]], 800)
cp.list
res <- detection_check(cp.list, brk, nob, critval = 5)
res
# use a stricter critical value
res <- detection_check(cp.list, brk, nob, critval = 10)
res
[Package VARDetect version 0.1.8 Index]