| SimpleSBM | R Documentation |
R6 class for Simple SBM
R6 class for Simple SBM
sbm::SBM -> SimpleSBM
dimLabelsa single character giving the label of the nodes
blockPropvector of block proportions (aka prior probabilities of each block)
connectParamparameters associated to the connectivity of the SBM, e.g. matrix of inter/inter block probabilities when model is Bernoulli
probMembershipsmatrix of estimated probabilities for block memberships for all nodes
nbBlocksnumber of blocks
nbDyadsnumber of dyads (potential edges in the network)
nbConnectParamnumber of parameter used for the connectivity
membershipsvector of clustering
indMembershipsmatrix for clustering memberships
new()constructor for SBM
SimpleSBM$new(
model,
nbNodes,
directed,
blockProp,
connectParam,
dimLabels = c("node"),
covarParam = numeric(length(covarList)),
covarList = list()
)modelcharacter describing the type of model
nbNodesnumber of nodes in the network
directedlogical, directed network or not.
blockPropparameters for block proportions (vector of list of vectors)
connectParamlist of parameters for connectivity with a matrix of means 'mean' and an optional scalar for the variance 'var'. The size of mu must match blockProp length
dimLabelsoptional label for the node (default is "nodeName")
covarParamoptional vector of covariates effect
covarListoptional list of covariates data
rMemberships()a method to sample new block memberships for the current SBM
SimpleSBM$rMemberships(store = FALSE)
storeshould the sampled blocks be stored (and overwrite the existing data)? Default to FALSE
the sampled blocks
rEdges()a method to sample a network data (edges) for the current SBM
SimpleSBM$rEdges(store = FALSE)
storeshould the sampled edges be stored (and overwrite the existing data)? Default to FALSE
the sampled network
predict()prediction under the currently parameters
SimpleSBM$predict(covarList = self$covarList, theta_p0 = 0)
covarLista list of covariates. By default, we use the covariates with which the model was estimated
theta_p0a threshold...
a matrix of expected values for each dyad
show()show method
SimpleSBM$show(type = "Simple Stochastic Block Model")
typecharacter used to specify the type of SBM
plot()basic matrix plot method for SimpleSBM object or mesoscopic plot
SimpleSBM$plot(
type = c("data", "expected", "meso"),
ordered = TRUE,
plotOptions = list()
)typecharacter for the type of plot: either 'data' (true connection), 'expected' (fitted connection) or 'meso' (mesoscopic view). Default to 'data'.
orderedlogical: should the rows and columns be reordered according to the clustering? Default to TRUE.
plotOptionslist with the parameters for the plot. See help of the corresponding S3 method for details.
a ggplot2 object for the 'data' and 'expected', a list with the igraph object g, the layout and the plotOptions for the 'meso'
clone()The objects of this class are cloneable with this method.
SimpleSBM$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.