Description Usage Arguments Details Value Examples
This function performs variational inference of bipartite Stochastic Block Models, with various model for the distribution of the edges: Bernoulli, Poisson, or Gaussian models.
1 2 3 4 5 6 7 |
netMat |
a matrix describing the network: either an adjacency (square) or incidence matrix with possibly weighted entries. |
model |
character describing the model for the relation between nodes ( |
dimLabels |
an optional list of labels for each dimension (in row, in column) |
covariates |
a list of matrices with same dimension as mat describing covariates at the edge level. No covariate per Default. |
estimOptions |
a list of parameters controlling the inference algorithm and model selection. See details. |
The list of parameters estimOptions
essentially tunes the optimization process and the variational EM algorithm, with the following parameters
"nbCores"integer for number of cores used. Default is 2
"verbosity"integer for verbosity (0, 1). Default is 1
"plot"boolean, should the ICL by dynamically plotted or not. Default is TRUE
"exploreFactor"control the exploration of the number of groups
"nbBlocksRange"minimal and maximal number or blocks explored
"fast"logical: should approximation be used for Bernoulli model with covariates. Default to TRUE
a list with the estimated parameters. See details...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ### =======================================
### BIPARTITE BINARY SBM (Bernoulli model)
## Graph parameters and Sampling
nbNodes <- c(60, 80)
blockProp <- list(c(.5, .5), c(1/3, 1/3, 1/3)) # group proportions
means <- matrix(runif(6), 2, 3) # connectivity matrix
# In Bernoulli SBM, parameters is a list with a
# matrix of means 'mean' which are probabilities of connection
connectParam <- list(mean = means)
mySampler <- sampleBipartiteSBM(nbNodes, blockProp, connectParam, model = 'bernoulli')
## Estimation
myBipartiteSBM <- estimateBipartiteSBM(mySampler$networkData, estimOptions = list(plot = FALSE))
plot(myBipartiteSBM, 'expected')
### =======================================
### BIPARTITE POISSON SBM
## Graph parameters & Sampling
nbNodes <- c(60, 80)
blockProp <- list(c(.5, .5), c(1/3, 1/3, 1/3)) # group proportions
means <- matrix(rbinom(6, 30, 0.25), 2, 3) # connectivity matrix
connectParam <- list(mean = means)
mySampler <- sampleBipartiteSBM(nbNodes, blockProp, connectParam, model = 'poisson')
## Estimation
myBipartiteSBM <-
estimateBipartiteSBM(mySampler$networkData, 'poisson', estimOptions = list(plot = FALSE))
plot(myBipartiteSBM, 'expected')
### =======================================
### BIPARTITE GAUSSIAN SBM
## Graph parameters & sampling
nbNodes <- c(60, 80)
blockProp <- list(c(.5, .5), c(1/3, 1/3, 1/3)) # group proportions
means <- 20 * matrix(runif(6), 2, 3) # connectivity matrix
connectParam <- list(mean = means, var = 1)
mySampler <- sampleBipartiteSBM(nbNodes, blockProp, connectParam, model = 'gaussian')
## Estimation
myBipartiteSBM <-
estimateBipartiteSBM(mySampler$networkData, 'gaussian', estimOptions = list(plot = FALSE))
plot(myBipartiteSBM, 'expected')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.