Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stergm_MCMC_sample

Collects a sample of networks and returns the formation and dissolution statistics of each sample


Description

stergm_MCMC_sample is a low-level internal function not intended to be called directly by end users. It collects a sample of networks and returns the formation and dissolution statistics of each sample, along with a toggle matrix of the changes needed from the original network to each in the sample.

stergm_MCMC_slave is an even lower-level function that actually calls the C code.

Usage

stergm_MCMC_sample(
  nw,
  model.form,
  model.diss,
  model.mon,
  proposal.form,
  proposal.diss,
  control,
  theta.form = NULL,
  theta.diss = NULL,
  verbose = FALSE,
  ...,
  eta.form = ergm.eta(theta.form, model.form$etamap),
  eta.diss = ergm.eta(theta.diss, model.diss$etamap)
)

stergm_MCMC_slave(
  Clist.form,
  Clist.diss,
  Clist.mon,
  proposal.form,
  proposal.diss,
  eta.form,
  eta.diss,
  control,
  verbose
)

Arguments

nw

a network object

model.form, model.diss, model.mon

formation, dissolution, and monitoring model, as returned by ergm_model

proposal.form, proposal.diss

a list of parameters needed for proposals of the formations and dissolutions

control

list of control paramters, probably from control.stergm

verbose

logical; whether this and other functions should be verbose

eta.form, eta.diss

vectors of natural parameters.

Clist.form, Clist.diss, Clist.mon

formation, dissolution, and monitoring "Clist", as returned by ergm.Cprepare

Details

This function is normally called inside simulate.stergm to prepare inputs for the C sampling code and return its results

Value

returns the MCMC sample as a list containing:

  • statsmatrix.form: the matrix of sampled statistics for 'model.form' RELATIVE TO INITIAL NETWORK

  • statsmatrix.diss: the matrix of sampled statistics for 'model.diss' RELATIVE TO INITIAL NETWORK

  • statsmatrix.mon: the matrix of sampled statistics for 'model.mon' RELATIVE TO INITIAL NETWORK

  • newnetwork : the final network from the sampling process

  • changed : a toggle matrix, where the first column is the timestamp of the toggle and the 2nd and 3rd columns are the head & tail of the toggle; this is only returned if control$changes is not NULL

  • maxchanges : the "MCMC Dyn workspace"; see 'maxchanges' in the input param list

See Also


tergm

Fit, Simulate and Diagnose Models for Network Evolution Based on Exponential-Family Random Graph Models

v3.7.0
GPL-3 + file LICENSE
Authors
Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Mark S. Handcock [aut, ths], David R. Hunter [ctb], Steven M. Goodreau [ctb, ths], Martina Morris [ctb, ths], Nicole Bohme Carnegie [ctb], Carter T. Butts [ctb], Ayn Leslie-Cook [ctb], Skye Bender-deMoll [ctb], Li Wang [ctb], Kirk Li [ctb], Chad Klumb [ctb]
Initial release
2020-10-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.