simulate_baseline: Simulate a baseline baseline model

Description Usage Arguments Details Value Examples

View source: R/count_motifs.R

Description

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)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

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.

Value

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

Examples

1
2
3
4
## Not run: 
simulate_baseline(ml_net, list("1,2[I.C]"), n = 10, directed = FALSE)

## End(Not run)

motifr documentation built on Dec. 15, 2020, 5:23 p.m.