Skip to content

Instantly share code, notes, and snippets.

View aleszib's full-sized avatar

Aleš Žiberna aleszib

View GitHub Profile
@aleszib
aleszib / stochBlockMay2021.R
Created May 5, 2021 09:29
R Code for linked stochastic blockmodeling
library(blockmodeling)
stochBlock<-function(M, clu, eps=0, each=FALSE,weights=NULL, eachProb=FALSE, nMode=NULL, limits=NULL, design0=TRUE, weightClusterSize = 1){
wc<-weightClusterSize
n<-dim(M)[1]
# mean05<-function(x)mean(c(x,0.5), na.rm=TRUE)
if(is.null(weights)){
weights<-M