simulate.ergm.ego: Simulate from a 'ergm.ego' fit.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/simulate.ergm.ego.R

Description

A wrapper around simulate.formula to simulate networks from an ERGM fit using ergm.ego.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'ergm.ego'
simulate(
  object,
  nsim = 1,
  seed = NULL,
  constraints = object$constraints,
  popsize = if (object$popsize == 1) object$ppopsize else object$popsize,
  control = control.simulate.ergm.ego(),
  output = c("network", "stats", "edgelist", "pending_update_network", "ergm_state"),
  ...,
  verbose = FALSE
)

Arguments

object

An ergm.ego fit.

nsim

Number of realizations to simulate.

seed

Random seed.

constraints, ...

Additional arguments passed to san and simulate.formula.

popsize

Either network size to which to scale the model for simulation or a data.frame with at least those ego attributes required to estimate the model, to simulate over a specific set of actors.

control

A control.simulate.ergm.ego control list.

output

one of "network", "stats", "edgelist", "pending_update_network", or, for future compatibility, "ergm_state". See help for simulate.ergm() for explanation.

verbose

Verbosity of output.

Value

The ouput has the same format (with the same options) as simulate.formula. If output="stats" is passed, an additional attribute, "ppopsize" is set, giving the actual size of the network reconstructed, when the pop.wt control parameter is set to "round" and "popsize" is not a multiple of the egocentric sample size or the sampling weights.

Author(s)

Pavel N. Krivitsky

References

Pavel N. Krivitsky and Martina Morris. Inference for Social Network Models from Egocentrically-Sampled Data, with Application to Understanding Persistent Racial Disparities in HIV Prevalence in the US. Thechnical Report. National Institute for Applied Statistics Research Australia, University of Wollongong, 2015(05-15). doi: 10.1214/16-AOAS1010

Pavel N. Krivitsky, Mark S. Handcock, and Martina Morris. Adjusting for Network Size and Composition Effects in Exponential-Family Random Graph Models. Statistical Methodology, 2011, 8(4), 319-339. doi: 10.1016/j.stamet.2011.01.005

See Also

simulate.formula, simulate.ergm

Examples

1
2
3
4
5
6
7
8
9
data(faux.mesa.high)
fmh.ego <- as.egor(faux.mesa.high)
data(fmhfit)
colMeans(egosim <- simulate(fmhfit, popsize=300,nsim=50,
                       output="stats", control=control.simulate.ergm.ego(
                       simulate=control.simulate.formula(MCMC.burnin=2e6))))
colMeans(egosim)/attr(egosim,"ppopsize")*network.size(faux.mesa.high)
summary(faux.mesa.high~edges+degree(0:3)+nodefactor("Race")+nodematch("Race")
           +nodefactor("Sex")+nodematch("Sex")+absdiff("Grade"))

statnet/ergm.ego documentation built on April 26, 2021, 4:46 a.m.