hergm-postprocess {hergm}R Documentation

Hierarchical Exponential-Family Random Graph Models: Postprocessing Samples

Description

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.

Usage


hergm.postprocess(sample = NULL,
                  burnin = 0, 
                  thinning = 1,
                  relabel = FALSE,
                  name = NULL, 
                  ...)

Arguments

sample

MCMC sample generated by function hergm.

burnin

number of burn-in iterations; if computing is parallel, number of burn-in iterations per processor.

thinning

if thinning > 1, every thinning-th sample point is used while all others discarded.

relabel

if TRUE, relabel MCMC sample.

name

name of project; if output == TRUE, name of project is used to name output files.

...

additional arguments, to be passed to lower-level functions in the future.

Value

ergm_theta

parameters of ergm-terms.

alpha

scaling parameter of truncated Dirichlet process / stick-breaking prior of parameters of hergm-terms.

eta_mean

mean parameters of Gaussian base distribution of parameters of hergm-terms.

eta_precision

precision parameters of Gaussian base distribution of parameters of hergm-terms.

hergm_theta

parameters of hergm-terms.

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.

See Also

network, hergm.example, hergm, ergm.terms, hergm.terms

Examples

## 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)

[Package hergm version 1.3-5 Index]