| FitSBM {MLVSBM} | R Documentation |
An R6 Class object for unilevel network
Description
a fitted level of a unilevel network once $do_vem() is done
Public fields
vboundvector of variational bound for convergence monitoring
Active bindings
adjacencyGet the adjacency matrix
maskGet the mask matrix for dealing with NA
nb_nodesGet the number of nodes of the level
nb_clustersGet the number of blocks
distributionGet the distribution used for the connections
directedGet if the level is directed or not
mixture_parameterAccess the block proportions
connectivity_parameterAccess the connectivity matrix
membershipAccess the variational parameters
entropyGet the entropy of the model
boundGet the variational bound of the model
df_mixtureGet the degree of freedom of the block proportion
df_connectGet the degree of freedom of the connection parameters
connectGet the number of observed dyads
ICLGet the ICL model selection criterion
penaltyGet the penalty used for computing the ICL
ZAccess the vector of block membership (clustering)
X_hatGet the connection probability matrix
X_likelihoodadjacency part of the log likelihood
Z_likelihoodblock part of the log likelihood
likelihoodcomplete log likelihood
Methods
Public methods
Method new()
Constructor for FitSBM R6 class
Usage
FitSBM$new( Q = 1, X = NULL, M = NULL, directed = FALSE, distribution = "bernoulli" )
Arguments
QNumber of blocks
XAdjacency matrix
MMask matrix
directedboolean
distributionstring (only "bernoulli")
Returns
A new FitSBM object
Method update_alpha()
Update the connection parameter for the M step
Usage
FitSBM$update_alpha(safeguard = 1e-06)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method update_pi()
Update the upper level mixture parameter for the M step
Usage
FitSBM$update_pi(safeguard = 1e-06)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method init_clustering()
init_clustering Initial clustering for VEM algorithm
Usage
FitSBM$init_clustering(safeguard = 1e-06, method = "hierarchical", Z = NULL)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
methodAlgorithm used to initiate the clustering, either "spectral", "hierarchical" or "merge_split" (if
Zis provided)ZInitial clustering if provided
Method m_step()
m_step Compute the M step of the VEM algorithm
Usage
FitSBM$m_step(safeguard = 1e-06)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method ve_step()
Compute the VE step of the VEM algorithm
Usage
FitSBM$ve_step(threshold = 1e-06, fixPointIter = 100, safeguard = 1e-06)
Arguments
thresholdThe convergence threshold
fixPointIterThe maximum number of fixed point iterations
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method do_vem()
Launch a Variational EM algorithm
Usage
FitSBM$do_vem( init = "hierarchical", threshold = 1e-06, maxIter = 1000, fixPointIter = 100, safeguard = 1e-06, Z = NULL )
Arguments
initThe method for
self$init_clusteringthresholdThe convergence threshold
maxIterThe max number of VEM iterations
fixPointIterThe max number of fixed point iterations for VE step
safeguardParameter live in a compact [safeguard, 1-safeguard]
ZInitial clustering if provided
Method permute_empty_class()
permute_empty_class Put empty blocks numbers at the end
Usage
FitSBM$permute_empty_class()
Method clear()
Reset all parameters
Usage
FitSBM$clear()
Method clone()
The objects of this class are cloneable with this method.
Usage
FitSBM$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.