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
}

Try the BTdecayLasso package in your browser

Any scripts or data that you put into this service are public.

BTdecayLasso documentation built on May 1, 2019, 8:24 p.m.