library(GREMLINS)Please use GREMLINS through the package
sbmGREMLINS is the inference engine of the package
sbm, which calls it to fit multipartite block models. We recommend not to use GREMLINS directly, but the functionestimateMultipartiteSBM()ofsbm.sbmimplements the same model and the same algorithm, with a simpler and unified interface (shared with simple, bipartite and multiplex networks), plot functions and more examples. GREMLINS is mostly maintained as a back-end ofsbm.
GREMLINS sbmdefineNetwork()defineSBM()rMBM()sampleMultipartiteSBM()multipartiteBM()estimateMultipartiteSBM()multipartiteBMFixedModel()estimateMultipartiteSBM()with equal bounds innbBlocksRangeextractClustersMBM()$membershipspredictMBM()predict()(none) plot(),plotMyMultipartiteMatrix()See the vignette Multipartite Stochastic Block Models of
sbm:vignette("Multipartite_EcologicalNetwork", package = "sbm").
The goal of GREMLINS is to perform statistical analysis of multipartite networks through a block model approach.
Multipartite networks consist in the joint observation of several networks implying some common individuals. The individuals (or entities represented by nodes) at stake are partitioned into groups defined by their nature. In what follows, these groups will be referred to as functional groups.
library(GREMLINS)The model is introduced and described in Bar-Hen et al. (2022).
Assume that functional groups of individuals are at stake. A multipartite network is a collection of networks, each of them implying one or two functional groups. Thus, each network may be
We index the collection of networks by pairs of functional groups . The set denotes the list of pairs of functional groups for which we observe an interaction network.
For any pair , the interaction network is encoded in a matrix such that if there is an edge from unit of functional group to unit of functional group , otherwise.
For any , may be in or a numeric for weighted networks.
Note that, if , is said to be an incidence matrix (corresponding to a bipartite network). If , is an adjacency matrix. Moreover, if the relation inside the functional group is non-oriented, is symmetric.
Let be the number of individuals in the -th functional group. Assume that each functional group is divided into blocks, or equivalently clusters. and , let be the latent random variable such that if individual of functional group belongs to cluster . The random variables ’s are assumed to be independent and such that: ,
with , .
Conditionally on the clustering, the entries of the matrices are assumed to be independent and distributed as follows: ,
meaning that the probability of connection from of functional group to of functional group only depends on the clusters to which they belong.
For any pair , is either:
As a consequence, the collection of networks may contain weighted and/or binary networks.
The inference of the model consists in the selection of the numbers of clusters and the estimation of the parameters . The model selection is performed with the ICL, a penalized likelihood criterion. The parameters are estimated with a variational version of the EM algorithm. The estimation procedure also provides a clustering of the entities at stake.
The algorithm is initialised with stochastic block models (or latent block models) fitted on each network separately with the package blockmodels (Leger 2016). Missing data (NA) are allowed in the matrices.