Compute the log likelihood of a DCSBM, using estimated parameters B, theta based on the given label vector

eval_dcsbm_like(A, z, poi = T, eps = 1e-06)

Arguments

A

adjacency matrix

z

label vector

poi

whether to use Poisson version of likelihood

eps

truncation threshold for the Bernoulli likelihood, used when parameter phat is close to 1 or 0.

Value

log likelihood of a DCSBM

Details

The log likelihood is calculated by $$\ell(\hat B,\hat \theta, \hat \pi, \hat z \mid A) = \sum_i \log \hat \pi_{z_i} + \sum_{i < j} \phi(A_{ij};\hat \theta_i \hat \theta_j \hat B_{\hat{z}_i \hat{z}_j} )$$ where \(\hat B\), \(\hat \theta\) is calculated by estim_dcsbm, \(\hat{\pi}_k\) is the proportion of nodes in community k.