# Finding Significant Links with gHypEGs

### Estimate the ensemble

First we estimate a soft-configuration model from the data. The second model is a block model based on the two 'factions' of members of the club

mod <- scm(adj_karate,directed = F, selfloops = F) blockModel <- bccm(adj = adj_karate, labels = vertexlabels, directed = F, selfloops = F, homophily = F)

We use the built-in function in the ghypernet package to compute the significance of each link as described in Casiraghi et al. 2017. The function takes the adjacency matrix of the network and the model from which estimating the probability to observe as many edges as those in the graph. We can obtain a high-pass noise filtering choosing a significance level and filtering those links which have a low significance.

# obtain significance matrix signmat <- linkSignificance(adj_karate, mod, under = FALSE) # filter adjacency matrix adjfiltered <- adj_karate adjfiltered[signmat>(1/mod$m)] <- 0 adjfiltered[signmat<(1/mod$m) & adj_karate==0] <- 1 diag(adjfiltered) <- 0

### Plot the results

We plot the original graph first, then a graph were the non-significant links are coloured red. The final plot only shows the significant links.

Note that the configuration model is not able to predict the strong links within the groups, as those go beyond simple degree effects. The results reflect this showing the two factions separated and only the links due to homophily effect left.