Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'ergm':
mcmc.diagnostics(object, sample = "sample", smooth = TRUE,
r = 0.0125, digits = 6, maxplot = 1000, verbose = TRUE,
center = TRUE, main = "Summary of MCMC samples", xlab =
"Iterations", ylab = "", \dots)
ergm
.object
on which the
diagnosis is based. The two usuals ones are thetasample
from the
auxilary sample of the natural parameter and sample
the (default)
sample of the sufficient statisticsTRUE
, print out more information about the MCMC runs including lag correlations.mcmc.diagnostics.ergm
returns a matrix of
Raftery-Lewis diagnostics.The Raftery-Lewis diagnostic is a run length control diagnostic based on a criterion of accuracy of estimation of the quantile q. It is intended for use on a short pilot run of a Markov chain. The number of iterations required to estimate the quantile q to within an accuracy of +/- r with probability p is calculated. Separate calculations are performed for each variable within each chain.
In fact, an object
contains the matrix of
statistics from the MCMC run as component $sample
.
This matrix is actually an object of class mcmc
and
can be used directly in the CODA
package to assess MCMC
convergence. Hence all MCMC diagnostic methods available
in coda
are available directly. See the examples and
More information can be found by looking at the documentation of
ergm
.
Raftery, A.E. and Lewis, S.M. (1992). One long run with diagnostics: Implementation strategies for Markov chain Monte Carlo. Statistical Science, 7, 493-497.
Raftery, A.E. and Lewis, S.M. (1995). The number of iterations, convergence diagnostics and generic Metropolis algorithms. In Practical Markov Chain Monte Carlo (W.R. Gilks, D.J. Spiegelhalter and S. Richardson, eds.). London, U.K.: Chapman and Hall.
ergm
, network
,
coda
, mcgibbsit
,
summary.ergm
#
data(florentine)
#
# test the mcmc.diagnostics function
#
gest <- ergm(flomarriage ~ edges + kstar(2))
summary(gest)
#
# Plot the probabilities first
#
mcmc.diagnostics(gest)
#
# Use coda directly
#
library(coda)
#
plot(gest$sample, ask=FALSE)
ergm.raftery.diag(gest$sample, r=0.1)
#
# A full range of diagnostics are available
# using codamenu()
#
Run the code above in your browser using DataLab