mcmc.diagnostics.ergmm: Conduct MCMC diagnostics on an ERGMM fit
Description
This function creates simple diagnostic plots for the MCMC sampled
statistics produced from a fit. It also prints the Raftery-Lewis
diagnostics, indicates if they are sufficient,
and suggests the run length required.
Usage
## S3 method for class 'ergmm':
mcmc.diagnostics(x,which.diags=c("cor","acf","trace","raftery"),
burnin=FALSE,
which.vars=NULL,
vertex.i=c(1),...)
A list of diagnostics to produce. "cor" is the correlation
matrix of the statistics, "acf" plots the autocorrelation functions, "trace"
produces trace plots, and "raftery" produces the Raftery-Lewis statistics.
burnin
If TRUE, generates an
mcmc.list object for the burnin (if stored)
instead of the main sampling run.
which.vars
A named list mapping variable names to the indices
to include. If given, overrides the defaults and all arguments that follow.
vertex.i
A numeric vector of vertices whose latent space
coordinates to include.
...
Additional arguments. None are supported at the moment.
Value
mcmc.diagnostics.ergmm returns a table of Raftery-Lewis diagnostics.
Details
The plots produced are a trace of the sampled output
and a density estimate for each variable in the chain.
Autocorrelation with lags 0 and 1 and a Raftery-Lewis diagnostic is prited.
#data(sampson)
## test the mcmc.diagnostics function#gest <- ergmm(samplike ~ latent(d=2))
summary(gest)
## Plot the traces and densities#mcmc.diagnostics(gest)