expSBM_EM {expSBM} | R Documentation |
expSBM_EM
Description
Runs the variational expectation maximization algorithm for a given number of latent groups.
Usage
expSBM_EM(N, edgelist, Z, lambda, mu, nu, directed = F, trunc = T,
tol = 0.001, n_iter_max = 100, verbose = F)
Arguments
N |
Number of nodes. |
edgelist |
A matrix with 4 columns: on the first column the sender node, on the second the receiver, on the third either a one or zero to indicate whether it is an interaction or a non-interaction respectively, on the fourth the corresponding exponential length. |
Z |
A |
lambda |
Mixing proportions of the latent groups. |
mu |
A matrix of size |
nu |
A matrix of size |
directed |
|
trunc |
|
tol |
Stop the maximization if the relative increase in the objective function is not larger than this value. |
n_iter_max |
Stop the maximization if the number of iterations is larger than this value. This parameter can be set to zero or one for debug purposes. |
verbose |
|
Value
computing_time |
Number of seconds required for the evaluation. |
elbo_values |
Stored values of the objective function at each iteration. |
Z_star |
Optimal soft clustering of the nodes into the groups. |
lambda_star |
Optimal mixing proportions. |
mu_star |
Optimal group-specific parameters for the exponential rates of the interaction lengths. |
nu_star |
Optimal group-specific parameters for the exponential rates of the non-interaction lengths. |
Examples
set.seed(1)
data(high_school)
K <- 4
lambda_init <- rep(1/K,K)
Z_init <- expSBM_init(high_school$edgelist, K, "random")
mu_init <- nu_init <- matrix(1,K,K)
expSBM_EM(N = 327, high_school$edgelist, Z_init, lambda_init, mu_init, nu_init)