R/distanceDegreeMIC.R

Defines functions distanceDegreeMIC

Documented in distanceDegreeMIC

distanceDegreeMIC <- function(g, dist=NULL) {
  if (class(g)[1] != "graphNEL")
    stop("'g' must be a 'graphNEL' object")
  if (is.null(dist))
    dist <- distanceMatrix(g)

  distdeg <- rowSums(dist)
  W <- wiener(g, dist=dist)
  pis <- distdeg / 2 / W

  -sum(pis * log2(pis))
}

Try the QuACN package in your browser

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

QuACN documentation built on May 2, 2019, 8:18 a.m.