An R6 Class object, a fitted population of netowrks sbm once $optimize() is done
fitBipartiteSBMPop.RdAn R6 Class object, a fitted population of netowrks sbm once $optimize() is done
An R6 Class object, a fitted population of netowrks sbm once $optimize() is done
Public fields
nA list with two dimensions, each of size M for the rows and cols
MNumber of networks
AList of incidence Matrix of size
n[[1]][m]xn[[2]][m]maskList of M masks, indicating NAs in the matrices. 1 for NA, 0 else
nonNAsList of M masks, indicating non NAs in the matrices. 1 - mask, so 0 for NA, 1 for non NA
nb_interA vector of length M the number of unique non NA entries
QNumber of clusters, vectors of size2
tauList of size M of list of two variational parameters.
n[[1]][m]xQmatrices andn[[2]][m]xQmatricesalphaMatrix of size QxQ, connection parameters
piList of M vectors of size Q, the mixture parameters
pimList of M vectors of size Q, the mixture parameters in case of free_mixture
eVector of size M, the sum of unique entries
emqrList of M QxQ matrix, the sum of edges between q and r in m, ie the edges that are observed.
nmqrlist of M QxQ matrix, the number of entries between q and r in m, ie all the possible edges.
alphamlist of M QxQ matrix, the classic sbm parameters.
free_mixture_rowA boolean indicating if there is a free mixture on the rows
free_mixture_colA boolean indicating if there is a free mixture on the columns
weightA vector of size M for weighted likelihood
distributionEmission distribution either : "poisson" or "bernoulli"
mlossLoss on the M step of the VEM
vlossLoss on the VE step of the VEM
vboundThe variational bound
entropyThe entropy of the variational distribution
net_idA vector containing the "ids" or names of the networks (if none given, they are set to their number in A list)
df_mixtureThe degrees of freedom for mixture parameters pi,used to compute penalty
df_connectThe degrees of freedom for connection parameters alpha,used to compute penalty
CpiA list of matrices of size Qd x M containing TRUE (1) or FALSE (0) if the d-th dimension cluster is represented in the network m
CalphaThe corresponding support on the connectivity parameters computed with Cpi.
logfactAA quantity used with the Poisson probability distribution
init_methodThe initialization method used for the first clustering
penaltyThe penalty computed based on the number of parameters
ZThe clusters memberships, a list of size M of two matrices : 1 for rows clusters memberships and 2 for columns clusters memberships
MAPMaximum a posteriori
MAP_parametersMAP params
ICLStores the ICL of the model
BICLStores the BICL of the model
fit_optsFit parameters, used to determine the fitting method/
step_counterCounts the number of passes
greedy_exploration_starting_pointStores the coordinates Q1 & Q2 from the greedy exploration to keep track of the starting_point
effective_clustering_listA list of size M storing the number of the clusters that contains at least one point. Used for safety checks.
clustering_is_completeA boolean used to know if the model real blocks match the expected blocks.
tested_tausA vector of taus values for taus given by init_clust
tested_taus_vboundA vector of vbound values for taus given by init_clust
has_convergedA boolean, indicating wether the current fit object VEM converged or not
Active bindings
nb_nodesReturns n a list of the number of nodes per network
nb_blocksReturns Q a vector with 2 coordinates, Q1 and Q2 for the row blocks and the column blocks
supportReturns the Cpi, a list of M boolean matrices indicating which blocks are populated
prob_membershipsReturns the tau, the probabilities of memberships "a posteriori", after seeing the data
parametersReturns the list of parameters of the model, alpha, pi and rho
pred_dyadsPredicted dyads from the estimated probabilities and parameters
membershipsThe block memberships
Methods
Method new()
Initializes the fitBipartiteSBMPop object
Usage
fitBipartiteSBMPop$new(
A = NULL,
Q = NULL,
Z = NULL,
mask = NULL,
net_id = NULL,
distribution = NULL,
free_mixture_row = TRUE,
free_mixture_col = TRUE,
Cpi = NULL,
Calpha = NULL,
init_method = "spectral",
weight = NULL,
greedy_exploration_starting_point = NULL,
fit_opts = list(algo_ve = "fp", minibatch = TRUE, verbosity = 1)
)Arguments
AList of incidence Matrix of size
n[[2]][m]xn[[2]][m]QA vector of size 2 with the number of row blocks and column blocks
ZThe clusters memberships, a list of size M of two matrices : 1 for rows clusters memberships and 2 for columns clusters memberships
maskList of M masks, indicating NAs in the matrices. 1 for NA, 0 else
net_idA vector containing the "ids" or names of the networks (if none given, they are set to their number in A list)
distributionEmission distribution either : "poisson" or "bernoulli"
free_mixture_rowA boolean indicating if there is a free mixture on the rows
free_mixture_colA boolean indicating if there is a free mixture on the columns
CpiA list of matrices of size Qd x M containing TRUE (1) or FALSE (0) if the d-th dimension cluster is represented in the network m
CalphaThe corresponding support on the connectivity parameters computed with Cpi.
init_methodThe initialization method used for the first clustering
weightA vector of size M for weighted likelihood
greedy_exploration_starting_pointStores the coordinates Q1 & Q2 from the greedy exploration to keep track of the starting_point
fit_optsFit parameters, used to determine the fitting method/ Method to compute the maximum a posteriori for Z clustering
Method vb_tau_alpha()
Method vb_tau_pi()
Method compute_penalty()
Method compute_BICL()
Usage
fitBipartiteSBMPop$compute_BICL(
MAP = TRUE,
penalty_factor = self$fit_opts$penalty_factor,
store = TRUE
)Method fixed_point_tau()
Not really a fixed point as tau^1 depends only tau^2.
Method update_pim()
Method update_alpham()
Method taus_order()
The goal of this function is to test different values of tau and select the best one in the sense of the BICL (or vbound) ?
Method m_step()
Method ve_step()
Method optimize()
Usage
fitBipartiteSBMPop$optimize(
max_step = self$fit_opts$max_vem_steps,
tol = self$fit_opts$tolerance,
...
)