init_tergmLite: Initializes EpiModel netsim Object for tergmLite Simulation

View source: R/initialize.R

init_tergmLiteR Documentation

Initializes EpiModel netsim Object for tergmLite Simulation

Description

Initializes EpiModel netsim Object for tergmLite Simulation

Usage

init_tergmLite(dat)

Arguments

dat

A list object containing a networkDynamic object and other initialization information passed from netsim.

Details

This function is typically used within the initialization modules of EpiModel to establish the necessary infrastructure needed for tergmLite network resimulation. The example below demonstrates the specific information returned.

Value

Returns the list object dat and adds the element el which is an edgelist representation of the network. Also converts the nw element to a networkLite representation.

Examples

## Not run: 
library("EpiModel")
nw <- network_initialize(100)
formation <- ~edges
target.stats <- 50
coef.diss <- dissolution_coefs(dissolution = ~offset(edges), duration = 20)
x <- netest(nw, formation, target.stats, coef.diss, verbose = FALSE)

param <- param.net(inf.prob = 0.3)
init <- init.net(i.num = 10)
control <- control.net(type = "SI", nsteps = 100, nsims = 5, tergmLite = TRUE)

# networkLite representation after initialization
dat <- crosscheck.net(x, param, init, control)
dat <- initialize.net(x, param, init, control)
str(dat, max.level = 1)

# Element added is el (edgelist representation of network)...
dat$el

# ... and nw is now a networkLite
dat$nw[[1]]

## End(Not run)


statnet/tergmLite documentation built on July 25, 2022, 11 p.m.