eval_func function

Evaluation function, return the performance of simulation results

Evaluation function, return the performance of simulation results

eval_func(true_mats, est_mats)

Arguments

  • true_mats: a list of true matrices for all segments, the length of list equals to the true number of segments
  • est_mats: a list of estimated matrices for all simulation replications, for each element, it is a list of numeric matrices, representing the estimated matrices for segments

Returns

A list, containing the results for all measurements

  • sensitivity: A numeric vector, containing all the results for sensitivity over all replications
  • specificity: A numeric vector, including all the results for specificity over all replications
  • accuracy: A numeric vector, the results for accuracy over all replications
  • mcc: A numeric vector, the results for Matthew's correlation coefficients over all replications
  • false_reps: An integer vector, recording all the replications which falsely detects the change points, over-detect or under-detect

Examples

true_mats <- vector('list', 2) true_mats[[1]] <- matrix(c(1, 0, 0.5, 0.8), 2, 2, byrow = TRUE) true_mats[[2]] <- matrix(c(0, 0, 0, 0.75), 2, 2, byrow = TRUE) est_mats <- vector('list', 5) for(i in 1:5){ est_mats[[i]] <- vector('list', 2) est_mats[[i]][[1]] <- matrix(sample(c(0, 1, 2), size = 4, replace = TRUE), 2, 2, byrow = TRUE) est_mats[[i]][[2]] <- matrix(sample(c(0, 1), size = 4, replace = TRUE), 2, 2, byrow = TRUE) } perf_eval <- eval_func(true_mats, est_mats)
  • Maintainer: Yue Bai
  • License: GPL-2
  • Last published: 2024-06-15

Useful links