R/penaltyAmount.R

Defines functions penaltyAmount

penaltyAmount <- function(ability, weight) {
  n <- nrow(ability) - 1
  s <- 0
  for(i in 1:(n - 1)){
    for(j in (i + 1):n){
      s <- s + abs(ability[i, 1] - ability[j, 1])*weight[i, j]
    }
  }
  s
}
heilokchow/BTdecayLasso documentation built on Jan. 27, 2024, 2:33 p.m.