| BipartiteSBM {sbm} | R Documentation |
R6 class for Bipartite SBM
Description
R6 class for Bipartite SBM
R6 class for Bipartite SBM
Super class
sbm::SBM -> BipartiteSBM
Active bindings
dimLabelsvector of two characters giving the label of each connected dimension (row, col)
blockProplist of two vectors 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
nbBlocksvector of size 2: number of blocks (rows, columns)
nbDyadsnumber of dyads (potential edges in the network)
nbConnectParamnumber of parameter used for the connectivity
membershipslist of size 2: vector of memberships in row, in column.
indMembershipsmatrix for clustering memberships
Methods
Public methods
Inherited methods
Method new()
constructor for SBM
Usage
BipartiteSBM$new( model, nbNodes, blockProp, connectParam, dimLabels = c(row = "row", col = "col"), covarParam = numeric(length(covarList)), covarList = list() )
Arguments
modelcharacter describing the type of model
nbNodesnumber of nodes in each dimension of the network
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 dimensions of mu must match
blockProplengthsdimLabelsoptional labels of each dimension (in row, in column)
covarParamoptional vector of covariates effect
covarListoptional list of covariates data
Method rMemberships()
a method to sample new block memberships for the current SBM
Usage
BipartiteSBM$rMemberships(store = FALSE)
Arguments
storeshould the sampled blocks be stored (and overwrite the existing data)? Default to FALSE
Returns
the sampled blocks
Method rEdges()
a method to sample a network data (edges) for the current SBM
Usage
BipartiteSBM$rEdges(store = FALSE)
Arguments
storeshould the sampled edges be stored (and overwrite the existing data)? Default to FALSE
Returns
the sampled network
Method predict()
prediction under the current parameters
Usage
BipartiteSBM$predict(covarList = self$covarList, theta_p0 = 0)
Arguments
covarLista list of covariates. By default, we use the covariates with which the model was estimated.
theta_p0double for thresholding...
Method show()
show method
Usage
BipartiteSBM$show(type = "Bipartite Stochastic Block Model")
Arguments
typecharacter used to specify the type of SBM
Method plot()
basic matrix plot method for BipartiteSBM object or mesoscopic plot
Usage
BipartiteSBM$plot(
type = c("data", "expected", "meso"),
ordered = TRUE,
plotOptions = list()
)Arguments
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.
Returns
a ggplot2 object for the 'data' and 'expected', a list with the igraph object g, the layout and the plotOptions for the 'meso'
Method clone()
The objects of this class are cloneable with this method.
Usage
BipartiteSBM$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.