R/loss.R

Defines functions hubercls

hubercls <- function(r, delta) {
    d <- matrix(NA, nrow(r), ncol(r))
    for (i in 1:nrow(r)) {
        for (j in 1:ncol(r)) {
            if (r[i, j] > 1) 
                d[i, j] <- 0 else {
                if (r[i, j] <= (1 - delta)) 
                  d[i, j] <- 1 - r[i, j] - 0.5 * delta else d[i, j] <- 0.5 * (1 - r[i, j])^2/delta
            }
        }
    }
    d
} 

Try the gglasso package in your browser

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

gglasso documentation built on May 29, 2024, 2:38 a.m.