R/edgeEqualityMIC.R

Defines functions edgeEqualityMIC

Documented in edgeEqualityMIC

edgeEqualityMIC <- function(g, deg=NULL) {
  if (class(g)[1] != "graphNEL")
    stop("'g' has to be a 'graphNEL' object")
  stopifnot(.validateGraph(g))
  if (is.null(deg))
    deg <- graph::degree(g)

  conns <- .edgeApply(g, function(from, to) deg[[from]] * deg[[to]],
                      dupls=FALSE)
  cls <- table(conns)
  p <- as.numeric(cls / numEdges(g))

  -sum(p * log2(p))
}

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, 5:46 p.m.