hausdorff_check: function for hausdorff distance computation

hausdorff_checkR Documentation

function for hausdorff distance computation

Description

The function includes two hausdorff distance. The first one is hausdorff_true_est (d(A_n, tilde{A}_n^f)): for each estimated change point, we find the closest true CP and compute the distance, then take the maximum of distances. The second one is hausdorff_est_true(d(tilde{A}_n^f, A_n)): for each true change point, find the closest estimated change point and compute the distance, then take the maximum of distances.

Usage

hausdorff_check(pts.final, brk)

Arguments

pts.final

a list of estimated change points

brk

the true change points

Value

hausdorff distance summary results, including mean, standard deviation and median.

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 <- hausdorff_check(cp.list, brk)
res


VARDetect documentation built on May 10, 2022, 9:07 a.m.