multipartiteBMFixedModel: Model selection and estimation of multipartite blockmodels

Description Usage Arguments Value Examples

View source: R/multipartiteBMFixedModel.R

Description

Select the number of blocks per functional group using a stepwise search and estimate parameters

Usage

1
2
multipartiteBMFixedModel(list_Net, namesFG, v_K = NULL, v_distrib,
  classifInit = NULL, nbCores = NULL)

Arguments

list_Net

A list of network (defined via the function DefineNetwork)

namesFG

Names of functional groups (must correspond to names in listNet)

v_K

A vector with the numbers of blocks per functional group

classifInit

A list of initial classification for each functional group in the same order as in namesFG

nb_cores

Number of cores used for estimation

Value

Estimated parameters and a classification

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
v_K <- c(3,2,2)
n_FG <- 3
list_pi <- vector("list", 3);
list_pi[[1]] <- c(0.4,0.3,0.3); list_pi[[2]] <- c(0.6,0.4); list_pi[[3]]  <- c(0.6,0.4)
E  = rbind(c(1,2),c(2,3),c(2,2))
v_distrib <- c('bernoulli','poisson','poisson')
typeInter <- c( "inc", "inc"  ,  "adj" )
list_theta <- list()
list_theta[[1]] <- matrix(rbeta(v_K[E[1,1]] * v_K[E[1,2]],1.5,1.5 ),nrow = v_K[E[1,1]], ncol = v_K[E[1,2]])
list_theta[[2]] <- matrix(rgamma(v_K[E[2,1]] * v_K[E[2,2]],7.5,1 ),nrow = v_K[E[2,1]], ncol = v_K[E[2,2]])
list_theta[[3]] <- matrix(rgamma(v_K[E[3,1]] * v_K[E[3,2]],7.5,1 ),nrow = v_K[E[3,1]], ncol = v_K[E[3,2]])
list_theta[[3]] <- 0.5*(list_theta[[3]] + t(list_theta[[3]])) # symetrisation for network 3
v_NQ = c(100,50,40)
list_Net <- rMBM(v_NQ ,E , typeInter, v_distrib, list_pi, list_theta, seed=NULL, namesFG= c('A','B','D'))$list_Net
res <- multipartiteBMFixedModel(list_Net,namesFG = c('A','B','D'), v_K = c(3,2,2),v_distrib = v_distrib)

Demiperimetre/GREMLIN documentation built on Dec. 5, 2018, 2:24 a.m.