This is an internal function, not normally called directly by the user. The ergm.getMCMCsample
function samples networks using an MCMC algorithm via
MCMC_wrapper.C
and is caple of running in multiple threads using ergm.mcmcslave
.
The ergm.mcmcslave
function is that which the slave nodes in a parallel process will call to perform a validation on the mcmc equal to their slave number. It also returns an MCMC sample.
ergm.getMCMCsample(nw, model, MHproposal, eta0, control, verbose, response = NULL, ...)ergm.mcmcslave(Clist, MHproposal, eta0, control, verbose, ..., prev.run = NULL,
burnin = NULL, samplesize = NULL, interval = NULL, maxedges = NULL)
a network object
a model for the given 'nw' as returned by <ergm.getmodel>
a list of the parameters needed for Metropolis-Hastings proposals and the result of calling <MHproposal>
the initial eta coefficients
list of MCMC tuning parameters; (see control.ergm)
whether the C functions should be verbose; default=FALSE
characher, name of an edge attribute
additional arugments?
the list of parameters returned by ergm.Cprepare
output stats from previous run ???
number of proposals before any MCMC sampling is done. see control.ergm MCMC.burnin
number of network statistics, randomly drawn from a given distribution on the set of all networks, returned by the Metropolis-Hastings algorithm. see control.ergm MCMC.samplesize
number of proposals between sampled statistics. see control.ergm MCMC.interval
maximum number of edges expected in network. see control.ergm MCMC.init.maxedges
for ergm.getMCMCsample
,the sample as a list containing:
statsmatrix: the stats matrix for the sampled networks, RELATIVE TO THE ORIGINAL NETWORK!
newnetwork : the edgelist of the final sampled network
nedges : the number of edges in the 'newnetwork'
for ergm.mcmcslave
the MCMC sample as a list of the following:
s : the statsmatrix
newnwtails: the vector of tails for the new network- is this the final network sampled? - is this the original nw if 'maxedges' is 0
newnwheads: the vector of heads for the new network - same q's
Note that the returned stats will be relative to the original network, i.e., the calling function must shift the statistics if required. The calling function must also attach column names to the statistics matrix if required.