GREMLINS. Quick Mathematical Background

Please use GREMLINS through the package sbm

GREMLINS 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 function estimateMultipartiteSBM() of sbm. sbm implements 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 of sbm.

GREMLINS sbm
defineNetwork() defineSBM()
rMBM() sampleMultipartiteSBM()
multipartiteBM() estimateMultipartiteSBM()
multipartiteBMFixedModel() estimateMultipartiteSBM() with equal bounds in nbBlocksRange
extractClustersMBM() $memberships
predictMBM() 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)

Mathematical Background

The model is introduced and described in Bar-Hen et al. (2022).

A collection of networks

Assume that QQ 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

  • simple if it represents the relations inside a functional group,
  • bipartite if it represents the relations between individuals of two functional groups.

We index the collection of networks by pairs of functional groups (q,q′)(q,q'). The set EE denotes the list of pairs of functional groups for which we observe an interaction network.

For any pair (q,q′)∈E(q,q') \in E, the interaction network is encoded in a matrix Xqq′X^{qq'} such that Xii′qq′≠0X^{qq'}_{ii'} \neq 0 if there is an edge from unit ii of functional group qq to unit i′i' of functional group q′q', Xii′qq′=0X^{qq'}_{ii'} = 0 otherwise.

For any (q,q′)(q,q'), Xii′qq′X^{qq'}_{ii'} may be in {0,1}\{0,1\} or a numeric for weighted networks.

Note that, if q≠q′q \neq q', Xqq′X^{qq'} is said to be an incidence matrix (corresponding to a bipartite network). If q=q′q = q', XqqX^{qq} is an adjacency matrix. Moreover, if the relation inside the functional group qq is non-oriented, XqqX^{qq} is symmetric.

A probabilistic latent variables model

Let nqn_q be the number of individuals in the qq-th functional group. Assume that each functional group qq is divided into KqK_q blocks, or equivalently clusters. ∀q\forall q and ∀i\forall i, let ZiqZ^{q}_i be the latent random variable such that Ziq=kZ^q_i = k if individual ii of functional group qq belongs to cluster kk. The random variables ZiqZ^{q}_i’s are assumed to be independent and such that: ∀(i,k,q)∈{1,…,nq}×{1,…,Kq}×{1,…,Q}\forall (i,k,q) \in \{1,\dots,n_q\} \times \{1,\dots,K_q\} \times \{1,\dots,Q\},

ℙ(Ziq=k)=πkq,(1) \mathbb{P}(Z^{q}_i=k) = \pi^{q}_k, \qquad(1)

with ∑k=1Kqπkq=1\sum_{k=1}^{K_q}\pi^{q}_k=1, ∀q=1,…,Q\forall q=1,\dots, Q.

Conditionally on the clustering, the entries of the matrices (Xii′qq′)\left(X^{qq'}_{ii'}\right) are assumed to be independent and distributed as follows: ∀(i,i′)∈{1,…,nq}×{1,…,nq′}\forall (i,i') \in \{1,\dots,n_q\} \times \{1,\dots,n_{q'}\},

Xii′qq′|Ziq=k,Zi′q′=k′∼i.i.d.ℱqq′(θkk′qq′),(2) X^{qq'}_{ii'} \; | \; Z^{q}_i=k, Z^{q'}_{i'}=k' \sim_{i.i.d.} \mathcal{F}_{qq'}(\theta^{qq'}_{kk'}), \qquad(2)

meaning that the probability of connection from ii of functional group qq to i′i' of functional group q′q' only depends on the clusters to which they belong.

For any pair (q,q′)(q,q'), ℱqq′(⋅)\mathcal{F}_{qq'}(\cdot) is either:

  • Bernoulli, resulting into binary interactions,
  • Poisson for weighted networks of counts,
  • Gaussian, zero-inflated Gaussian or Laplace for continuous weighted networks.

As a consequence, the collection of networks may contain weighted and/or binary networks.

Statistical inference

The inference of the model consists in the selection of the numbers of clusters (Kq)q=1,…,Q(K_q)_{q=1,\dots,Q} and the estimation of the parameters (θqq′)(\theta^{qq'}). 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.

References

Bar-Hen, Avner, Pierre Barbillon, and Sophie Donnet. 2022. “Block Models for Generalized Multipartite Networks: Applications in Ecology and Ethnobiology.” Statistical Modelling 22 (4): 273–96. https://doi.org/10.1177/1471082X20963254.
Leger, Jean-Benoist. 2016. “Blockmodels: A r-Package for Estimating in Latent Block Model and Stochastic Block Model, with Various Probability Functions, with or Without Covariates.” arXiv Preprint arXiv:1602.07587.