Select the number of blocks and identify the blocks per functional group using a variational EM algorithm

multipartiteBM(
  list_Net,
  v_distrib = NULL,
  namesFG = NULL,
  v_Kmin = 1,
  v_Kmax = 10,
  v_Kinit = NULL,
  initBM = TRUE,
  save = FALSE,
  verbose = TRUE,
  nbCores = NULL,
  maxiterVE = NULL,
  maxiterVEM = NULL
)

Arguments

list_Net

a list of networks (defined via the function defineNetwork) i.e. a multipartite network

v_distrib

an optional vector of characters of length the number of networks and specifying the distribution used in each network (possible values bernoulli,poisson,gaussian,laplace). If not provided, the model will be 'bernoulli' for all the interactions matrices.

namesFG

an optional vector of characters containing the names of functional groups (FG) (If Specified, must correspond to the names in list_Net).

v_Kmin

an optional vector of integers, specifying the minimal number of blocks per functional group (must be provided in the same order as in namesFG). v_Kmin may be a single value (same minimal number of blocks for all the FGs) or a vector with size equal to the number of FGs. Default value = 1.

v_Kmax

an optional vector of integers specifying the maximal number of blocks per functional group provided in the same order as in namesFG. v_Kmax may be a single value (same maximal number of blocks for all the FGs) or a vector with size equal to the number of FGs. Default value = 10.

v_Kinit

an optional vector of integers specifying initial numbers of blocks per FG provided in the same order as in namesFG. if v_Kinit is not specified, then v_Kinit = v_Kmin

initBM

an optional boolean. If initBM = TRUE an aditional initialisation is done using simple LBM or SBM on each network separatly. Default value = TRUE

save

an optional boolean. If TRUE save the estimated parameters for intermediate visited models. Otherwise, only the better model (in ICL sense) is the ouput. Default value = FALSE.

verbose

an optional boolean. If TRUE, display the current step of the search algorithm

nbCores

an optional integer specifying the number or cores used for the estimation. Not parallelized on windows. If ncores = NULL, then half of the cores are used.

maxiterVE

an optional integer specifying the maximum number of iterations in the VE step of the VEM algorithm. If NULL then default value = 1000

maxiterVEM

an optional integer specifying the maximum number of iterations of the VEM algorithm. If NULL then default value Default value = 1000

Value

a list of estimated parameters for the different models ordered by decreasing ICL. If save = FALSE, the length is of length 1 (only the better model is returned).

fittedModel

contains the results of the inference. res$fittedModel[[1]] is a list with fields

paramEstim

a MBMfit object.

ICL

the penalized likelihood criterion ICL.

vJ

the sequence of the varational bound of the likelihood through iterations of the VEM.

convergence

TRUE if the VEM reached convergence.

list_Net

contains the data.

Details

The function multipartiteBM selects the better numbers of blocks in each FG (with a penalized likelihood criterion). The model selection is performed with a forward backward strategy and the likelihood of each model is maximized with a variational EM).

Examples

namesFG <- c('A','B') list_pi <- list(c(0.16 ,0.40 ,0.44),c(0.3,0.7)) # prop of blocks in each FG E <- rbind(c(1,2),c(2,2),c(1,1)) # architecture of the multipartite net. typeInter <- c( "inc","diradj", "adj") # type of each network v_distrib <- c('gaussian','bernoulli','poisson') list_theta <- list() list_theta[[1]] <- list() list_theta[[1]]$mean <- matrix(c(6.1, 8.9, 6.6, 9.8, 2.6, 1.0), 3, 2) list_theta[[1]]$var <- matrix(c(1.6, 1.6, 1.8, 1.7 ,2.3, 1.5),3, 2) list_theta[[2]] <- matrix(c(0.7,1.0, 0.4, 0.6),2, 2) m3 <- matrix(c(2.5, 2.6 ,2.2 ,2.2, 2.7 ,3.0 ,3.6, 3.5, 3.3),3,3 ) list_theta[[3]] <- (m3 + t(m3))/2 list_Net <- rMBM(v_NQ = c(60,50),E , typeInter, v_distrib, list_pi, list_theta, namesFG = namesFG, seed = 2)$list_Net res_MBMsimu <- multipartiteBM(list_Net, v_distrib, namesFG = c('A','B'), v_Kinit = c(2,2), nbCores = 2,initBM = FALSE)
#> [1] "------------Nb of entities in each functional group--------------" #> A B #> 60 50 #> [1] "------------Probability distributions on each network--------------" #> [1] "gaussian" "bernoulli" "poisson" #> [1] "-------------------------------------------------------------------" #> [1] " ------ Searching the numbers of blocks starting from [ 2 2 ] blocks" #> [1] "ICL : -6247.51 . Nb of blocks: [ 2 2 ]" #> [1] "ICL : -5727.89 . Nb of blocks: [ 3 2 ]" #> [1] "Best model------ ICL : -5727.89 . Nb of clusters: [ 3 2 ] for [ A , B ] respectively"