powered by
This function allows you to fit single level stochastic block models.
fit_sbm( A, K, a0 = 0.5, b10 = 0.5, b20 = 0.5, n_iter = 1000, burn = 100, verbose = TRUE )
An n x n symmetric adjacency matrix.
The number of clusters specified a priori.
Dirichlet prior parameter for cluster sizes for clusters 1,...,K.
Beta distribution prior paramter for community connectivity.
Beta distribution prior parameter for community connectivity.
The number of total MCMC iterations to run.
The number of burn-in MCMC iterations to discard. The number of saved iterations will be n_iter - burn.
Whether to print a progress bar to track MCMC progress. Defaults to true.
A list of MCMC samples, including the MAP estimate of cluster indicators (z)
# NOT RUN { data(AL) fit <- fit_sbm(AL[[1]],3) # }
Run the code above in your browser using DataLab