The method to plot the fitBipartite objects
fitBipartiteSBMPop.Rd
The method to plot the fitBipartite objects
The method to plot the fitBipartite objects
Public fields
n
A list with two dimensions, each of size M for the rows and cols
M
Number of networks
A
List of incidence Matrix of size
n[[1]][m]xn[[2]][m]
mask
List of M masks, indicating NAs in the matrices. 1 for NA, 0 else
nonNAs
List of M masks, indicating non NAs in the matrices. 1 - mask, so 0 for NA, 1 for non NA
nb_inter
A vector of length M the number of unique non NA entries
Q
Number of clusters, vectors of size2
tau
List of size M of list of two variational parameters.
n[[1]][m]xQ
matrices andn[[2]][m]xQ
matricesalpha
Matrix of size QxQ, connection parameters
pi
List of M vectors of size Q, the mixture parameters
pim
List of M vectors of size Q, the mixture parameters in case of free_mixture
e
Vector of size M, the sum of unique entries
emqr
List of M QxQ matrix, the sum of edges between q and r in m, ie the edges that are observed.
nmqr
list of M QxQ matrix, the number of entries between q and r in m, ie all the possible edges.
alpham
list of M QxQ matrix, the classic sbm parameters.
free_mixture_row
A boolean indicating if there is a free mixture on the rows
free_mixture_col
A boolean indicating if there is a free mixture on the columns
weight
A vector of size M for weighted likelihood
distribution
Emission distribution either : "poisson" or "bernoulli"
mloss
Loss on the M step of the VEM
vloss
Loss on the VE step of the VEM
vbound
The variational bound
entropy
The entropy of the variational distribution
net_id
A vector containing the "ids" or names of the networks (if none given, they are set to their number in A list)
df_mixture
The degrees of freedom for mixture parameters pi,used to compute penalty
df_connect
The degrees of freedom for connection parameters alpha,used to compute penalty
Cpi
A 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
Calpha
The corresponding support on the connectivity parameters computed with Cpi.
logfactA
A quantity used with the Poisson probability distribution
init_method
The initialization method used for the first clustering
penalty
The penalty computed based on the number of parameters
Z
The clusters memberships, a list of size M of two matrices : 1 for rows clusters memberships and 2 for columns clusters memberships
MAP
Maximum a posteriori
MAP_parameters
MAP params
ICL
Stores the ICL of the model
BICL
Stores the BICL of the model
fit_opts
Fit parameters, used to determine the fitting method/
step_counter
Counts the number of passes
greedy_exploration_starting_point
Stores the coordinates Q1 & Q2 from the greedy exploration to keep track of the starting_point
effective_clustering_list
A list of size M storing the number of the clusters that contains at least one point. Used for safety checks.
clustering_is_complete
A boolean used to know if the model real blocks match the expected blocks.
tested_taus
A vector of taus values for taus given by init_clust
tested_taus_vbound
A vector of vbound values for taus given by init_clust
has_converged
A boolean, indicating wether the current fit object VEM converged or not
Active bindings
nb_nodes
Returns n a list of the number of nodes per network
nb_blocks
Returns Q a vector with 2 coordinates, Q1 and Q2 for the row blocks and the column blocks
support
Returns the Cpi, a list of M boolean matrices indicating which blocks are populated
prob_memberships
Returns the tau, the probabilities of memberships "a posteriori", after seeing the data
parameters
Returns the list of parameters of the model, alpha, pi and rho
pred_dyads
Predicted dyads from the estimated probabilities and parameters
memberships
The 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
A
List of incidence Matrix of size
n[[2]][m]xn[[2]][m]
Q
A vector of size 2 with the number of row blocks and column blocks
Z
The clusters memberships, a list of size M of two matrices : 1 for rows clusters memberships and 2 for columns clusters memberships
mask
List of M masks, indicating NAs in the matrices. 1 for NA, 0 else
net_id
A vector containing the "ids" or names of the networks (if none given, they are set to their number in A list)
distribution
Emission distribution either : "poisson" or "bernoulli"
free_mixture_row
A boolean indicating if there is a free mixture on the rows
free_mixture_col
A boolean indicating if there is a free mixture on the columns
Cpi
A 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
Calpha
The corresponding support on the connectivity parameters computed with Cpi.
init_method
The initialization method used for the first clustering
weight
A vector of size M for weighted likelihood
greedy_exploration_starting_point
Stores the coordinates Q1 & Q2 from the greedy exploration to keep track of the starting_point
fit_opts
Fit 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 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,
...
)
Method plot()
Usage
fitBipartiteSBMPop$plot(
type = "graphon",
oRow = NULL,
oCol = NULL,
mixture = FALSE,
net_id = NULL,
values = FALSE,
...
)
Arguments
type
The type of the plot. Could be "graphon", "meso" or "block".
oRow
A reordering of the row blocks.
oCol
A reordering of the column blocks.
mixture
Should the block proportions of each network be plotted as well?
net_id
Use to plot only one network in "graphon" view.
values
Wether or not to plot values on the alpha, pi and rho representation.
...
Further argument to be passed