A baseline distribution of motif counts from a specified number of networks using a specified baseline model is computed. Options for the baseline model are - Erdős–Rényi - Actor's choice - Fixed density - Providing an ERGM fit for the whole network - Providing a partial ERGM fit (for only one level)

simulate_baseline(
  net,
  motifs,
  n = 10,
  lvl_attr = "sesType",
  assume_sparse = TRUE,
  model = "erdos_renyi",
  level = -1,
  ergm_model = NULL,
  directed = NULL
)

Arguments

net

network object

motifs

list of motif identifier strings

n

number of random graphs

lvl_attr

character string specifying the attribute name where level information is stored in net.

assume_sparse

whether the random graphs shall be assumed to be sparse. used to find ideal counting function. defaults to TRUE.

model

baseline model to be used. Options are 'erdos_renyi', 'fixed_densities', 'actors_choice', 'ergm' and 'partial_ergm'. See vignette("random_baselines") for more details. Defaults to 'erdos_renyi'.

level

lvl_attr of the variable level for the Actor's Choice model and for partial ERGM

ergm_model

ergm model as for example fitted by calling ergm::ergm(). Used when model is set to 'ergm' or 'partial_ergm' to sample random networks.

directed

whether the graph shall be treated as a directed graph. Per default (NULL), this is determined automatically using the structure of the provided network object

Value

data frame with one column for each motif identifier string and one row for every computed random graph

Details

Note that when using the Actor's Choice model this function does not choose the variable level automatically. Use the level parameter to provide a valid level.

When using (partial) ERGM the parameter net is not used. Random networks are sampled in R using the ergm_model parameter.

Examples

# \dontrun{ simulate_baseline(ml_net, list("1,2[I.C]"), n = 10, directed = FALSE)
#> 1,2[I.C] #> 1 125 #> 2 208 #> 3 139 #> 4 141 #> 5 183 #> 6 130 #> 7 151 #> 8 222 #> 9 141 #> 10 156
# }