Perform estimation on blockmodels for gaussian probability distribution
BM_gaussian.RdWith the provided network and blockmodel type, estimate number of groups, parameters and node membership
Arguments
- membership_type
The type of node membership, i.e. 'SBM', 'SBM_sym' or 'LBM'
- adj
The adjacency matrix. It may contain missing values (
NA): the corresponding dyads are not observed, and are ignored in the likelihood, the estimation of the parameters and the ICL. This assumes that the dyads are missing at random; see the package missSBM for other sampling designs. The diagonal is ignored for SBM and SBM_sym memberships.- verbosity
The verbosity level, 0 means quiet. Level 1 display the phase of reinitialization. Level 2 display the level 1 and the ascending and descending phase for the number of groups. Level 3 display the level 2 and the number current number of groups which is estimated. Level 4 display the level 3 and the steps inside the estimation. Level 5 display the level 4, the current status of parallel running jobs and the current sub-step. Level 6 display level 5 and informations about ICL criteria found. Default is level 6. This parameter can be changed by accessing to the field $verbosity of the object.
- autosave
If autosave != ”, after each estimation, the model object is writed into file autosave. The model object is readable by the function readRDS. Use-it for long computation to allow restarting the estimation on system crash. You can use it to alanyze the partial results when the estimation is running. This parameter can be changed by accessing to the field $autosave of the object.
- plotting
Control plot of ICL values while the estimation is running. If plotting==character(0) (the default), plots are done on screen, if plotting==”, no plot are done, if plotting is a filename, plots are done in this filename. This parameter can be changed by accessing the field $plotting of the object.
- exploration_factor
Control the exploration of the number of groups. The exploration is stop when the number of groups reach exploration factor times the current maximum. By default 1.5. This parameter can be changed by accessing the field $exploration_factor of the object.
- explore_min
Explore to the explore_min number of groups even if the exploration_factor rule is satisfied. By default 4. This parameter can be changed by accessing the field $explore_min of the object.
- explore_max
Stop exploration after explore_max number of group in any case. By default Inf. This parameter can be changed by accessing the field $explore_max of the object.
- exploration_direction
Only for LBM membership. Control the exploration direction for groups number. When provided, the exploring strategy is made to explore the provided group number. Must be a vector of two integer value representing the row group number and the column group number.
- ncores
Number of parallel jobs to launch different EM intializations. By default detectCores(). This parameter can be changed by accessing the field $ncores of the object. This parameters is used only on Linux. Parallism is disabled on other plateform. (Not working on Windows, not tested on Mac OS, not tested on *BSD.)
- nodes_covariates
A list containing the (optional) nodes covariates. For SBM or SBM_sym, the list must contain one element named 'node', a matrix with as many rows as the number of nodes. For the LBM membership type, the list may contain one or two elements, named 'row' or 'col', the elements must be matrices with the number of rows corresponding to the number of nodes for the corresponding type of nodes (row or col). The block proportions of each node are given by a multinomial logistic regression on its covariates: include a column of ones in the matrix to have an intercept. The covariates must not contain missing values.
Examples
if (FALSE) { # \dontrun{
##
## SBM
##
## generation of one SBM network
npc <- 30 # nodes per class
Q <- 3 # classes
n <- npc * Q # nodes
Z<-diag(Q)%x%matrix(1,npc,1)
Mu<-20*matrix(runif(Q*Q),Q,Q)
M<-matrix(rnorm(n*n,sd=10),n,n)+Z%*%Mu%*%t(Z) ## adjacency matrix
## estimation
my_model <- BM_gaussian("SBM",M )
my_model$estimate()
which.max(my_model$ICL)
##
## SBM symmetric
##
## generation of one SBM_sym network
npc <- 30 # nodes per class
Q <- 3 # classes
n <- npc * Q # nodes
Z<-diag(Q)%x%matrix(1,npc,1)
Mu<-20*matrix(runif(Q*Q),Q,Q)
Mu[lower.tri(Mu)]<-t(Mu)[lower.tri(Mu)]
M<-matrix(rnorm(n*n,sd=10),n,n)+Z%*%Mu%*%t(Z) ## adjacency matrix
M[lower.tri(M)]<-t(M)[lower.tri(M)]
## estimation
my_model <- BM_gaussian("SBM_sym",M )
my_model$estimate()
which.max(my_model$ICL)
##
## LBM
##
## generation of one LBM network
npc <- c(50,40) # nodes per class
Q <- c(2,3) # classes
n <- npc * Q # nodes
Z1<-diag(Q[1])%x%matrix(1,npc[1],1)
Z2<-diag(Q[2])%x%matrix(1,npc[2],1)
Mu<-20*matrix(runif(Q[1]*Q[2]),Q[1],Q[2])
M<-matrix(rnorm(n[1]*n[2],sd=10),n[1],n[2])+Z1%*%Mu%*%t(Z2) ## adjacency matrix
## estimation
my_model <- BM_gaussian("LBM",M )
my_model$estimate()
which.max(my_model$ICL)
} # }