An R6 Class object, a fitted generalized multilevel network once $dovem() is done
An R6 Class object, a fitted generalized multilevel network once $dovem() is done
Public fields
vbound
The vector of variational bound for monitoring convergence
Active bindings
affiliation_matrix
Get the affiliation matrix
adjacency_matrix
Get the list of adjacency matrices
nb_nodes
Get the list of the number of nodes
nb_clusters
Get the list of the number of blocks
nb_levels
Get the number of levels
block_proportions
Get the block proportions of each level
parameters
Get the list of the model parameters
membership
Get the list of the variational parameters
independent
Are the levels independent?
distribution
Emission distribution of each level
directed
Are the levels directed?
entropy
Get the entropy of the model
bound
Get the variational bound of the model
df_mixture
Get the degrees of freedom of the
mixture parameters
df_connect
Get the degrees of freedom of the
connection parameters
connect
Get the number of possible observed connections
ICL
Get the ICL model selection criterion of the model
full_penalty
Get the penalty used to compute the ICL
Z
Get the list of block memberships (vector form)
X_hat
Get the list of the matrices of probability connection
predictions
map
Get the list of block memberships (matrix form)
penalty
Get the ICL penalty
likelihood
Compute the likelihood of both levels
complete_likelihood
Get the complete likelihood of the model
Methods
Method new()
Constructor for the FitMLVSBM class
Usage
FitGenMLVSBM$new(
Q = NULL,
A = NULL,
X = NULL,
M = NULL,
directed = NULL,
distribution = NULL,
independent = FALSE,
no_affiliation = NULL
)
Arguments
Q
Vector with the number of blocks
A
List of affiliation matrice
X
List of adjacency matrices
M
List of Mask matrices
directed
Vector of boolean
distribution
Vector of string
independent
Boolean
no_affiliation
A vector of boolean.
For each level, are there any nodes with no affiliations?
Returns
A FitGenMLVSBM object
Method update_alpha()
Update the connection parameters for the M step
Usage
FitGenMLVSBM$update_alpha(m, safeguard = 2 * .Machine$double.eps)
Arguments
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method update_pi()
Update the mixture parameter for the M step of level m
Usage
FitGenMLVSBM$update_pi(m, safeguard = 0.001)
Arguments
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method update_gamma()
Update the hierarchical mixture parameter for the M step
Usage
FitGenMLVSBM$update_gamma(m, safeguard = 1e-06)
Arguments
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method init_clustering()
init_clustering Initial clustering for VEM algorithm
Usage
FitGenMLVSBM$init_clustering(
safeguard = 2 * .Machine$double.eps,
method = "hierarchical",
Z = NULL
)
Arguments
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
method
Algorithm used to initiate the clustering, either
"spectral", "hierarchical" or "merge_split" (if Z
is provided)
Z
Initial clustering if provided
Method clear()
Reset all parameters
Method m_step()
m_step Compute the M step of the VEM algorithm
Usage
FitGenMLVSBM$m_step(m, safeguard = 1e-06)
Arguments
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method ve_step()
Compute the VE step of the VEM algorithm
Usage
FitGenMLVSBM$ve_step(m, threshold = 1e-06, fixPointIter = 3, safeguard = 1e-06)
Arguments
m
The level to be updated
threshold
The convergence threshold
fixPointIter
The maximum number of fixed point iterations
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method ve_step2()
Compute the VE step of the VEM algorithm
Usage
FitGenMLVSBM$ve_step2(threshold = 1e-06, fixPointIter = 5, safeguard = 1e-06)
Arguments
threshold
The convergence threshold
fixPointIter
The maximum number of fixed point iterations
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Method update_mqr()
Usage
FitGenMLVSBM$update_mqr(m)
Method do_vem()
Launch a Variational EM algorithm
Usage
FitGenMLVSBM$do_vem(
init = "hierarchical",
threshold = 1e-06,
maxIter = 1000,
fixPointIter = 10,
safeguard = 1e-06,
Z = NULL
)
Arguments
init
The method for self$init_clustering
threshold
The convergence threshold
maxIter
The max number of VEM iterations
fixPointIter
The max number of fixed point iterations for VE step
safeguard
Parameter live in a compact [safeguard, 1-safeguard]
Z
Initial clustering if provided
Method permute_empty_class()
permute_empty_class Put empty blocks numbers at the end
Usage
FitGenMLVSBM$permute_empty_class(m)
Method xz_loglikelihood()
Usage
FitGenMLVSBM$xz_loglikelihood(m)
Method za_loglikelihood()
Usage
FitGenMLVSBM$za_loglikelihood(m)
Reorder the block memberships and parameters of the networks
Usage
FitGenMLVSBM$reorder(order = "affiliation")
Arguments
order
One of c("affiliation", "degree")
Plot of FitMLVSBM objects
Usage
FitGenMLVSBM$plot(type = c("matrix"), ...)
Arguments
type
A string for the type of plot, just "matrix" for now
Method show()
print method
Usage
FitGenMLVSBM$show(type = "Multilevel Stochastic Block Model")
Arguments
type
character to tune the displayed name
Method clone()
The objects of this class are cloneable with this method.
Usage
FitGenMLVSBM$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.