R/net.kernel.R

Defines functions net.kernel

Documented in net.kernel

# kernel matrix
net.kernel <- function (g, decay = 0.5) 
{
  L <- as.matrix(laplacian_matrix(g, normalized = TRUE))
  colname <- colnames(L)
  rowname <- rownames(L)
  I <- diag(1, dim(L))
  K <- chol2inv(chol(I + decay * L))
  colnames(K) <- colname
  rownames(K) <- rowname
  return(K)
}

Try the PPInfer package in your browser

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

PPInfer documentation built on May 2, 2018, 3:11 a.m.