fit_sbm {mlsbm} | R Documentation |
R/Rcpp function for fitting single level stochastic block model
Description
This function allows you to fit single level stochastic block models.
Usage
fit_sbm(
A,
K,
a0 = 0.5,
b10 = 0.5,
b20 = 0.5,
n_iter = 1000,
burn = 100,
verbose = TRUE
)
Arguments
A |
An n x n symmetric adjacency matrix. |
K |
The number of clusters specified a priori. |
a0 |
Dirichlet prior parameter for cluster sizes for clusters 1,...,K. |
b10 |
Beta distribution prior paramter for community connectivity. |
b20 |
Beta distribution prior parameter for community connectivity. |
n_iter |
The number of total MCMC iterations to run. |
burn |
The number of burn-in MCMC iterations to discard. The number of saved iterations will be n_iter - burn. |
verbose |
Whether to print a progress bar to track MCMC progress. Defaults to true. |
Value
A list of MCMC samples, including the MAP estimate of cluster indicators (z)
Examples
data(AL)
fit <- fit_sbm(AL[[1]],3)
[Package mlsbm version 0.99.2 Index]