hergm-postprocess {hergm} | R Documentation |
If called with the option simulate = TRUE
, the function hergm
returns a sample of networks, otherwise a raw MCMC sample from the posterior.
The function hergm.postprocess
postprocesses samples:
if called with the relabel = FALSE
,
hergm.postprocess
extracts information of interest,
otherwise it solves, in addition, the so-called label-switching problem.
The label-switching problem is rooted in the invariance of the likelihood function to permutations of the labels of blocks, and implies that the raw MCMC sample cannot be used to infer to block-dependent entities.
The label-switching problem can be solved in a Bayesian decision-theoretic framework: by defining a loss function and minimizing the posterior expected loss.
Calling hergm.process
minimizes the posterior expected loss using a simple and convenient loss function.
The required computations can be time-consuming when the number of blocks k
is large.
hergm.postprocess(sample = NULL, burnin = 0, thinning = 1, relabel = FALSE, name = NULL, ...)
sample |
MCMC sample generated by function |
burnin |
number of burn-in iterations; if computing is parallel, number of burn-in iterations per processor. |
thinning |
if |
relabel |
if |
name |
name of project; if |
... |
additional arguments, to be passed to lower-level functions in the future. |
ergm_theta |
parameters of |
alpha |
scaling parameter of truncated Dirichlet process / stick-breaking prior of parameters of |
eta_mean |
mean parameters of Gaussian base distribution of parameters of |
eta_precision |
precision parameters of Gaussian base distribution of parameters of |
hergm_theta |
parameters of |
p_k |
probabilities of membership to blocks. |
indicator |
indicators of memberships of nodes. |
p_i_k |
probabilities of membership of nodes to blocks. |
prediction |
posterior predictions of statistics. |
network, hergm.example, hergm, ergm.terms, hergm.terms
## Not run: # Load undirected network with 15 nodes (see ?example) data(example) # Generate MCMC sample of size 1,000 mcmc <- hergm(d ~ edges_i, parallel = 1, samplesize = 1000) # Postprocess MCMC sample of size 1,000 processed_mcmc <- hergm.postprocess(sample = mcmc, burnin = 200) # Generate MCMC sample of size 20 * 100 = 2,000 mcmc <- hergm(d ~ edges + triangle_ijk, parallel = 20, samplesize = 100) # Postprocess MCMC sample of size 20 * 100 = 2,000 processed_mcmc <- hergm.postprocess(sample = mcmc, burnin = 20) ## End(Not run)