R/net.kernel.R

# 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 Nov. 8, 2020, 7:52 p.m.