Internal Function to Sample Networks and Network Statistics
This is an internal function, not normally called directly by the
user. The ergm_MCMC_sample
function samples networks and
network statistics using an MCMC algorithm via MCMC_wrapper
and is caple of running in multiple threads using
ergm_MCMC_slave
.
The ergm_MCMC_slave
function calls the actual C
routine and does minimal preprocessing.
ergm_MCMC_sample( nw, model, proposal, control, theta = NULL, response = NULL, update.nws = TRUE, verbose = FALSE, ..., eta = ergm.eta(theta, model$etamap) ) ergm_MCMC_slave( Clist, proposal, eta, control, verbose, ..., prev.run = NULL, burnin = NULL, samplesize = NULL, interval = NULL, maxedges = NULL )
nw |
a |
model |
an |
proposal |
a list of the parameters needed for
Metropolis-Hastings proposals and the result of calling
|
control |
list of MCMC tuning parameters; see
|
theta |
the (possibly curved) parameters of the model. |
response |
Name of the edge attribute whose value is to be
modeled in the valued ERGM framework. Defaults to |
update.nws |
whether to actually update the network state or to return an object "promising" to update the network. |
verbose |
verbosity level. |
... |
additional arugments. |
eta |
the natural parameters of the model; by default constructed from |
Clist |
the list of parameters returned by
|
prev.run |
a summary of the state of the sampler allowing a
run to be resumed quickly by |
burnin, samplesize, interval, maxedges |
MCMC paramters that can
be used to temporarily override those in the |
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.
ergm_MCMC_sample
returns a list
containing:
stats |
an |
networks |
a list of final sampled networks, one for each thread. |
status |
status code, propagated from |
final.interval |
adaptively determined MCMC interval. |
If update.nws==FALSE
, rather than returning the updated networks,
the function will return a pending_update_network
.
ergm_MCMC_slave
returns the MCMC sample as a list of
the following:
s |
the matrix of statistics. |
newnwtails |
the vector of tails for the new network. |
newnwheads |
the vector of heads for the new network. |
newnwweights |
the vector of weights for the new network (if applicable) |
status |
success or failure code: |
maxedges |
maximum allowed edges at the time of return. |
ergm_MCMC_sample
and ergm_MCMC_slave
replace
ergm.getMCMCsample
and ergm.mcmcslave
respectively. They
differ slightly in their argument names and in their return
formats. For example, ergm_MCMC_sample
expects proposal
rather than MHproposal
and theta
or eta
rather than eta0
;
and it does not return statsmatrix
or newnetwork
elements. Rather, if parallel processing is not in effect,
stats
is an mcmc.list
with one chain and networks
is a
list with one element.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.