R/anomaly-pursuit.r

Defines functions anomaly_index

#' Anomaly index.
#'
#' Calculates an index that looks for the best projection of
#' observations that are outside a pre-determined p-D ellipse.
#'
#' @export
anomaly_index <- function() {

  function(mat, ell2d, ellmu2d) {

    mat_tab <- #mean(mahal_dist(mat, ell2d))
      mean(mahalanobis(mat, center=ellmu2d, cov=ell2d))
  }
}
ggobi/tourr documentation built on April 23, 2024, 11:11 p.m.