R/snlKdag.R

Defines functions snlKdag

snlKdag <- function(D){
  
  nn <- max(nrow(D),ncol(D))
  
  D <- .5*D
  vn <- colSums(D)/nn
  evnn <- sum(vn)/nn
  
  B <- matrix(rep(0,nn^2),nrow=nn)
  
  for(ii in 1:nn){
    for(jj in 1:nn){
      B[ii,jj] <- vn[ii] + vn[jj]
    }
  }
  
  B <- B - D
  B <- B - evnn
  
  return(B)
}

Try the edmcr package in your browser

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

edmcr documentation built on Sept. 10, 2021, 5:10 p.m.