R/bitimp.R

bit.importance <- function(actives, background) {
  bs.actives <- bit.spectrum(actives)
  bs.background <- bit.spectrum(background)

  m <- length(actives)
  n <- length(background)
  pa <- (m*bs.actives+bs.background)/(m+1)
  pb <- (n*bs.background+bs.actives)/(n+1)

  kl <- pa * log(pa/pb) + (1-pa) * log( (1-pa)/(1-pb) )
  kl[is.nan(kl)] <- NA
  return(kl)
}

Try the fingerprint package in your browser

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

fingerprint documentation built on May 2, 2019, 2:42 a.m.