detection_check function

Function for detection performance check

Function for detection performance check

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 jj-th true break point, tjt_j, if it falls in the interval [tj(tjtj1)/critval,tj+(tj+1tj)/critval][t_j - {(t_{j} - t_{j-1})}/{critval}, t_j + {(t_{j+1} - t_{j})}/{critval}], j=1,,m0j = 1,\dots, m_0.

Returns

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 errorj=t~jftj{error}_j =|\tilde{t}_j^f - t_j|, j=1,,m0j = 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
  • Maintainer: Yue Bai
  • License: GPL-2
  • Last published: 2024-06-15

Useful links