R/R6Class-missSBM_collection.R
missSBM_collection.RdThe function estimateMissSBM() fits a collection of SBM with missing data for
a varying number of block. These models with class missSBM_fit are stored in an instance
of an object with class missSBM_collection, described here.
Fields are accessed via active binding and cannot be changed by the user.
This class comes with a set of R6 methods, some of them being useful for the user and exported
as S3 methods. See the documentation for show() and print()
modelsa list of models
ICLthe vector of Integrated Classification Criterion (ICL) associated to the models in the collection (the smaller, the better)
bestModelthe best model according to the ICL
vBlocksa vector with the number of blocks
optimizationStatusa data.frame summarizing the optimization process for all models
new()constructor for networkSampling
missSBM_collection$new(partlyObservedNet, sampling, clusterInit, control)partlyObservedNetAn object with class partlyObservedNetwork.
samplingThe sampling design for the modelling of missing data: MAR designs ("dyad", "node") and MNAR designs ("double-standard", "block-dyad", "block-node" ,"degree")
clusterInitInitial clustering: a list of vectors, each with size ncol(adjacencyMatrix).
controla list of parameters controlling advanced features. Only 'trace' and 'useCov' are relevant here. See estimateMissSBM() for details.
estimate()method to launch the estimation of the collection of models
controla list of parameters controlling the variational EM algorithm. See details of function estimateMissSBM()
explore()method for performing exploration of the ICL
controla list of parameters controlling the exploration, similar to those found in the regular function estimateMissSBM()
plot()plot method for missSBM_collection
missSBM_collection$plot(type = c("icl", "elbo", "monitoring"))## Uncomment to set parallel computing with future
## future::plan("multicore", workers = 2)
## Sample 75% of dyads in French political Blogosphere's network data
adjacencyMatrix <- missSBM::frenchblog2007 %>%
igraph::delete.vertices(1:100) %>%
igraph::as_adj () %>%
missSBM::observeNetwork(sampling = "dyad", parameters = 0.75)
#> Warning: `as_adj()` was deprecated in igraph 2.1.0.
#> ℹ Please use `as_adjacency_matrix()` instead.
#> Warning: `delete.vertices()` was deprecated in igraph 2.0.0.
#> ℹ Please use `delete_vertices()` instead.
collection <- estimateMissSBM(adjacencyMatrix, 1:5, sampling = "dyad")
#>
#>
#> Adjusting Variational EM for Stochastic Block Model
#>
#> Imputation assumes a 'dyad' network-sampling process
#>
#> Initialization of 5 model(s).
#> Performing VEM inference
#> Model with 4 blocks.
Model with 3 blocks.
Model with 1 blocks.
Model with 5 blocks.
Model with 2 blocks.
#> Looking for better solutions
#> Pass 1 Going forward ++++
Pass 1 Going backward ++++
class(collection)
#> [1] "missSBM_collection" "R6"