sim_egonets: Simulation of longitudinal ego-networks according to a...

Description Usage Arguments Value References Examples

View source: R/sim_egonets.R

Description

This function simulated longitudinal ego-networks and estimates an ego-TERGM. Useful for monte carlos and proofs of concept.

Usage

1
2
3
4
sim_egonets(form = NULL, params = NULL, roles = NULL,
  N_per_role = NULL, t_steps = NULL, egonet_size = NULL, R = 10,
  forking = FALSE, ncpus = 1, steps = 50, tol = 1e-06,
  seed = 12345)

Arguments

form

A vector of ERGM terms that should be used to generate the networks.

params

A "roles" by "form" matrix of ERGM simulation parameters with groups defined on the row and model terms defined on the column.

roles

An integer for the number of distinct mixture groups that should be simulated.

N_per_role

An integer for the number of different longitudinally observed ego-networks that should be simulated per role in roles.

t_steps

An integer for the number of time steps that each ego-network should be observed across.

egonet_size

An integer for the size of each ego-network simulated.

R

The number of bootstrap replications that should be used for the estimation of a bootstrapped MPLE estimated TERGM for model initialization. Defaults to 10.

forking

If parallelization via forking should be used (TRUE) or if no parallel processing should be used (FALSE). Currently, sockets are not supported.

ncpus

The number of CPUs that should should be used for estimation, defaults to 1.

steps

The number of default EM steps that should be taken, defaults to 50.

tol

The difference in parameter estimates between EM iterations to determine if the algorithm has converged. Defaults to 1e-6.

seed

The seed set to replicate analysis for pseudorandom number generator.

Value

A list of simulated ego-networks and the output of the ego_tergm function fit to this.

References

#' Campbell, Benjamin W. (2018): Inferring Latent Roles in Longitudinal Networks. Political Analysis 26(3): 292-311. https://doi.org/10.1017/pan.2018.20

Salter-Townshend, Michael and Thomas Brendan Murphy. (2015): Role Analysis in Networks using Mixtures of Exponential Random Graph Models. Journal of Computational and Graphical Statistics 24(2): 520-538. https://doi.org/10.1080/10618600.2014.923777

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
net <- sim_egonets(form = c("edges", "gwesp(0.8,fixed=TRUE)", "gwdegree(decay=0.8,fixed=TRUE)"),
                  params = rbind(c(-3,1,0), c(-1,-2,-1), c(-2,0,2)),
                  roles = 3,
                  N_per_role = 10,
                  t_steps = 3,
                  egonet_size = 20,
                  seed = 12345,
                  R = 30,
                  forking = FALSE,
                  ncpus = 1,
                  steps = 50,
                  tol = 1e-6)

egoTERGM documentation built on May 17, 2019, 5:03 p.m.