tergm_MCMC_sample: Collects a sample of networks and returns the statistics of...

View source: R/tergm.getMCMCsample.R

tergm_MCMC_sampleR Documentation

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

Description

tergm_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 statistics of each sample, along with a toggle matrix of the changes needed from the original network to each in the sample.

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

Usage

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

tergm_MCMC_slave(state, eta, control, verbose)

Arguments

nw

a network object

model

the model, as returned by ergm_model

model.mon

the optional monitoring model, as returned by ergm_model

proposal

the proposal, as returned by ergm_proposal()

control

the list of control parameters

theta

the vector of curved parameters

verbose

A logical or an integer to control the amount of progress and diagnostic information to be printed. FALSE/0 produces minimal output, with higher values producing more detail. Note that very high values (5+) may significantly slow down processing.

eta

the vector of natural parameters

Details

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

Value

returns the MCMC sample as a list containing:

  • statsmatrix.gen: the matrix of sampled statistics for model, relative to the initial network

  • statsmatrix.mon: the matrix of sampled statistics for model.mon, relative to the initial network

  • newnetwork: ergm_state with the final network from the sampling process

  • changed: a matrix of changes, where the first column is the timestamp of the change, the second and third columns are the tail and head (respectively) of the changed dyad, and the fourth column is the edge state to which the dyad was changed; this is only returned if control$changes is TRUE

  • maxchanges: the maxchanges value from the control list

See Also

simulate.tergm()


tergm documentation built on Oct. 8, 2024, 5:09 p.m.