prepare_data {missSBM} | R Documentation |
This function puts together the adjacency matrix of a network and an optional list of covariates
into a single sampledNetwork
object, ready to use for inference with the estimate
function of the missSBM package.
prepare_data(adjacencyMatrix, covariates = NULL, similarity = missSBM:::l1_similarity)
adjacencyMatrix |
The adjacency matrix of the network (NAs allowed) |
covariates |
An optional list with M entries (the M covariates). If the covariates are node-centred, each entry of |
similarity |
An optional R x R -> R function to compute similarities between node covariates. Default is |
Returns an R6 object with class sampledNetwork
.
estimate
and sampledNetwork
.
data(war) adj_beligerent <- war$beligerent %>% igraph::as_adj(sparse = FALSE) sampledNet_war_nocov <- prepare_data(adj_beligerent) sampledNet_war_withcov <- prepare_data(adj_beligerent, list(military_power = war$beligerent$power))