hergm
The function hergm.postprocess
postprocesses an object of class hergm
.
Please note that the function hergm
calls the function hergm.postprocess
with relabel = 0
by default or with other values of relabel
specified by the user,
therefore users do not need to call the function hergm.postprocess
unless it is desired to postprocess an object of class hergm
with a value of relabel
that was not used by function hergm
.
If hergm.postprocess
is called with relabel > 0
,
it solves 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 raw MCMC samples from the posterior cannot be used to infer to block-dependent entities.
The label-switching problem can be solved in a Bayesian decision-theoretic framework: by choosing a loss function and minimizing the posterior expected loss.
Two loss functions are implemented in hergm.postprocess
, the loss function of Schweinberger and Handcock (2015) (relabel == 1
) and the loss function of Peng and Carvalho (2016) (relabel == 2
).
The first loss function seems to be superior in terms of the reported clustering probabilities, but is more expensive in terms of computing time.
A rule of thumb is to use the first loss function when max_number < 15
and use the second loss function otherwise.
hergm.postprocess(object,
burnin = 2000,
thinning = 1,
relabel = 1,
number_runs = 1,
...)
parameters of ergm-terms
.
concentration parameter of truncated Dirichlet process prior of parameters of hergm-terms
.
mean parameters of Gaussian base distribution of parameters of hergm-terms
.
precision parameters of Gaussian base distribution of parameters of hergm-terms
.
parameters of hergm-terms
.
if relabel == TRUE
, local minimum of loss function.
probabilities of block memberships of nodes.
indicators of block memberships of nodes.
posterior probabilities of block memberships of nodes.
posterior predictions of statistics.
object of class hergm
; objects of class hergm
can be generated by function hergm
.
number of posterior burn-in iterations; if computing is parallel, burnin
is applied to the sample generated by each processor;
please note that hergm
returns min(sample_size
, 10000) sample points and the burn-in is applied to the sample of size min(sample_size
, 10000), therefore burnin
should be smaller than min(sample_size
, 10000).
if thinning > 1
, every thinning
-th sample point is used while all others discarded; if computing is parallel, thinning
is applied to the sample generated by each processor; please note that hergm
returns min(sample_size
, 10000) sample points and the thinning is applied to the sample of size min(sample_size
, 10000) - burnin
, therefore thinning
should be smaller than min(sample_size
, 10000) - burnin
.
if relabel > 0
, relabel MCMC sample by minimizing the posterior expected loss of Schweinberger and Handcock (2015) (relabel == 1
) or Peng and Carvalho (2016) (relabel == 2
).
if relabel == 1
, number of runs of relabeling algorithm.
additional arguments, to be passed to lower-level functions in the future.
Peng, L. and L. Carvalho (2016). Bayesian degree-corrected stochastic block models for community detection. Electronic Journal of Statistics 10, 2746--2779.
Schweinberger, M. and M. S. Handcock (2015). Local dependence in random graph models: characterization, properties, and statistical Inference. Journal of the Royal Statistical Society, Series B (Statistical Methodology), 7, 647-676.
Schweinberger, M. and P. Luna (2018). HERGM: Hierarchical exponential-family random graph models. Journal of Statistical Software, 85, 1--39.
hergm