tergm_MCMC_sample {tergm} | R 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 |
model |
the model, as returned by |
model.mon |
the optional monitoring model, as returned by |
proposal |
the proposal, as returned by |
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. |
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 networkstatsmatrix.mon: the matrix of sampled statistics for
model.mon
, relative to the initial networknewnetwork:
ergm_state
with the final network from the sampling processchanged: 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
isTRUE
maxchanges: the
maxchanges
value from the control list