| FitMLVSBM {MLVSBM} | R Documentation |
An R6 Class object, a fitted multilevel network once $dovem() is done
Description
An R6 Class object, a fitted multilevel network once $dovem() is done
An R6 Class object, a fitted multilevel network once $dovem() is done
Public fields
vboundThe vector of variational bound for monitoring convergence
Active bindings
affiliation_matrixGet the affiliation matrix
adjacency_matrixGet the list of adjacency matrices
nb_nodesGet the list of the number of nodes
nb_clustersGet the list of the number of blocks
parametersGet the list of the model parameters
membershipGet the list of the variational parameters
independentAre the levels independent?
distributionEmission distribution of each level
directedAre the levels directed?
entropyGet the entropy of the model
boundGet the variational bound of the model
df_mixtureGet the degrees of freedom of the mixture parameters
df_connectGet the degrees of freedom of the connection parameters
connectGet the number of possible observed connections
ICLGet the ICL model selection criterion of the model
full_penaltyGet the penalty used to compute the ICL
ZGet the list of block memberships (vector form)
X_hatGet the list of the matrices of probability connection predictions
mapGet the list of block memberships (matrix form)
penaltyGet the ICL penalty
likelihoodCompute the likelihood of both levels
complete_likelihoodGet the complete likelihood of the model
Methods
Public methods
Method new()
Constructor for the FitMLVSBM class
Usage
FitMLVSBM$new(
Q = list(I = 1, O = 1),
A = NA,
X = NA,
M = list(I = NA, O = NA),
directed = NA,
distribution = list("bernoulli", "bernoulli"),
independent = FALSE
)Arguments
QList of number of blocks
AAffiliation matrix
XList of adjacency matrices
MList of Mask matrices
directedList of boolean
distributionList of string
independentBoolean
Returns
A FitMLVSBM object
Method update_alpha()
Update the connection parameters for the M step
Usage
FitMLVSBM$update_alpha(safeguard = 2 * .Machine$double.eps)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method update_pi()
Update the upper level mixture parameter for the M step
Usage
FitMLVSBM$update_pi(safeguard = 0.001)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method update_gamma()
Update the lower level mixture parameter for the M step
Usage
FitMLVSBM$update_gamma(safeguard = 1e-06)
Arguments
safeguardParameter live in a compact [safeguard, 1-safeguard]
Method init_clustering()
init_clustering Initial clustering for VEM algorithm
Usage
FitMLVSBM$init_clustering( safeguard = 2 * .Machine$double.eps, 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 clear()
Reset all parameters
Usage
FitMLVSBM$clear()
Method m_step()
m_step Compute the M step of the VEM algorithm
Usage
FitMLVSBM$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
FitMLVSBM$ve_step(threshold = 1e-06, fixPointIter = 10, 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
FitMLVSBM$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
FitMLVSBM$permute_empty_class()
Method plot()
Plot of FitMLVSBM objects
Usage
FitMLVSBM$plot(type = c("matrix"), ...)Arguments
typeA string for the type of plot, just "matrix" for now
Returns
a ggplot2 object
Method show()
print method
Usage
FitMLVSBM$show(type = "Multilevel Stochastic Block Model")
Arguments
typecharacter to tune the displayed name
Method print()
print method
Usage
FitMLVSBM$print()
Method clone()
The objects of this class are cloneable with this method.
Usage
FitMLVSBM$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.