## S3 method for class 'ergmm':
mcmc.diagnostics(object, sample = "sample",
smooth=TRUE, r = 0.0125, digits = 6,
maxplot = 1000, verbose = TRUE,
mcmc.title = "Summary of MCMC samples", \dots)
ergmm.raftery.diag(data, q = 0.025, rmargin = 0.005, s = 0.95, converge.eps = 0.001)
ergmm
.object
on which the
diagnosis is based. The two usual ones are thetasample
from the
auxiliary sample of the natural parameter and sample
the (default)
sample of the sufficient statisticsobject
on which the diagnosis is based.TRUE
, print out more information about the MCMC runs including lag correlations.mcmc.diagnostics.ergmm
returns a table 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, 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 MCMC diagnostic methods available
in coda
may be available directly. See the examples and
the coda
package.
This function depends on the coda
package.
More information can be found by looking at the documentation of
ergmm
.
#
data(sampson)
#
# test the mcmc.diagnostics function
#
gest <- ergmm(samplike ~ latent(k=2))
summary(gest)
#
# Plot the traces and densities
#
mcmc.diagnostics(gest)
Run the code above in your browser using DataLab