R/helperFunctions.R

Defines functions linearprod

# linearprod: helper-function: Will be needed for calculation of the
#             exact depth in linear runtime
# input: residuals: Vector of residuals; K: Parameter of the K Sign Depth
# output: Needed result
linearprod <- function(residuals, K = 4){
    M <- sum(residuals < 0)
    N <- length(residuals)
    C <- sum(choose(M, 0:K) * choose(N - M, K - 0:K) * (-1)^(0:K))
    return(C)
  }
melaniehorn/GSignTest documentation built on July 11, 2021, 1:18 a.m.